SQL Server – Change @@servername - sp_dropserver and sp_addserver

22 November,2012 by Jack Vamvas

Sometimes a server name needs to change . In those situations you need  make a change in SQL Server allowing SQL Server to use the latest name . 

Follow these steps to change the server name in SQL Server

Step 1- Check the current name by :


SELECT @@SERVERNAME  AS pre_change_name,       Serverproperty('Servername') AS current_server_name

If the two values are different use this procedure  to update the name


Step 2 – use sp_dropserver and sp_addserver


EXEC sp_addserver 'NEW_SERVER_NAME\MYINST1', 'local'

select @@servername 	
---Should now display the correct name 


Step 3  - Restart the service



 Read More

How to check Operating System type with Powershell

SQL Server Version with Powershell

Author: Jack Vamvas (http://www.sqlserver-dba.com)


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on SQL Server – Change @@servername - sp_dropserver and sp_addserver

sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer