-
Notifications
You must be signed in to change notification settings - Fork 0
MS SQL Server
cmshawns edited this page Dec 1, 2014
·
1 revision
Applies to: Microsoft SQL Server 2012
I encountered this need when I got the following error trying to add a user to my local SQL Server:
In my case, the problem was that the VM I was using had installed SQL Server with the hostname of the base image - which I had changed when (as instructed) when I started using it. This could be observed by running
SELECT @@SERVERNAME AS pre_change_name,
Serverproperty('Servername') AS current_server_name
Using sp_addserver
to set the correct hostname and then restarting SQL Server resolved my issue:
EXEC sp_dropserver 'OLD_SERVER_NAME'
EXEC sp_addserver 'NEW_SERVER_NAME', 'local'
C:\> NET STOP MSSQLSERVER
C:\> NET START MSSQLSERVER
Reference: