Wednesday, April 20, 2011

Renaming SQL server's Windows server name

Many of us have been confronted with the problem of having to rename a Windows server that has a SQL server installed on it. We feared arcane procedures that would take time and not completely provide the desired effect, which is a Windows server with a new name and the SQL server still running.

It would seem Microsoft has heard our curses, um, prayers.

This article provides instructions on how to change the name of in SQL server after you change the name on Windows. It's for SQL 2008 R2, which mandates Windows Server 2008 R2, but it's definitely an advancement. Below is a clip of the relevant instructions.

Also, I just renamed a vCenter Server that runs SQL Server Express, and it had no problem at all! When did they fix that?



To rename a computer that hosts a stand-alone instance of SQL Server

  • For a renamed computer that hosts a default instance of SQL Server, run the following procedures:

    sp_dropserver <old_name>
    GO
    sp_addserver <new_name>, local
    GO
    
    Restart the instance of SQL Server.
  • For a renamed computer that hosts a named instance of SQL Server, run the following procedures:

    sp_dropserver <'old_name\instancename'>
    GO
    sp_addserver <'new_name\instancename'>, local
    GO
    
    Restart the instance of SQL Server.

No comments:

Post a Comment