Wednesday, October 3, 2012

How to change the SQL SERVER name after changing the windows machine name

When we change the name of the windows machine on whom the SQL Server is running, then the SQL server name does not gets change. We need to manually add the new server name and remove the old server name.

Issue :- We have changed the windows machine name from Ahsi-PC to Shashank but when we look for the SQL Server name it will give the old windows machine name.

Step 1 : Run sp_dropserver 'Old server Name'on master database

Step 2 : - Run sp_addserver 'New server name','local' on master database. After running restart the SQL services.

Step 3 :- Check the new name of the instance by running select @@servername.

Now the SQL instance name has been changed after windows name change. Minimum rights required to perform the above action is setupadmin server role.

1 comment:

  1. Really good information to show through this blog. I really appreciate you for all the valuable information that you are providing us through your blog. SQL server dba Online Course