Rename a SQL Server, steps.

You've renamed the server itself. Now it's time to rename SQL instances from within SQL. You'll need to reboot the services after the rename.

 Let's see what the whole picture is now by running this.
  EXEC sp_helpserver

Get the old servername to use to drop it.
    SELECT  srvname AS OldServerName  FROM  master.dbo.sysservers WHERE srvid= 

Check the name of the server as it is now to use to create the new SQL instance name.
  EXEC master.dbo.xp_getnetname   

Now we have enough information to change the name. e.g.
    EXEC master.dbo.sp_dropserver  'SQLOld\I2K'

    EXEC master.dbo.sp_addserver 'SQLNew\I2K','local'
  

Running this should show the old server name until we restart the SQL Services.
     SELECT @@SERVERNAME  

— results in SQLOld\I2K

Stop and restart the SQL Server services.

— results in SQLNew\I2K

 

 

Comments are closed.

Post Navigation