If you’ve changed your Operating System hostname, you should reflect that change in SQL Server by updating the name in the Master database. SQL Server doesn’t support updating the name when involved in database mirroring, replication, or clustered environments. You’ll have to remove the feature, update the name, then re-add the feature.

 

SELECT * FROM [master].[sys].[servers]
 --Look for server_id=0 name is pointing to Server A
 --Server_id=0 is local server
 SELECT @@SERVERNAME --Returns(Server A)
 EXEC sp_dropserver 'ServerA'
 EXEC sp_addserver 'ServerB',local
 --Important step
 --Restart the local sql server service and the sql server agent service
 SELECT @@SERVERNAME --Returns(Server B)
 SELECT * FROM [master].[sys].[servers]
 --Look for server_id=0 name is pointing to Server B
 --Server_id=0 is local server

Read more about updating the name by Jugal Shah.

    Advertisment ad adsense adlogger