none
SQL 2005 - Rename a Named Instance

    Question

  • Hi all,

    Ok, first I am new to this so please be gentle. 

    1.  I created a named instance on a existing SQL 2000 server for a installation of SQL 2005.
    2.  After I named it, I decided that the name needed to be different (GOODNAME vs. BADNAME).
    3.  How do I rename a named instance (NOT default instance) of a SQL Server 2005 install?  I have completed the steps shown in this article. 

    http://msdn2.microsoft.com/en-us/library/ms143799.aspx


    But, it still shows as the name I do not want in the SQL Management Studio.   If I run the "PRINT @@servername", it does display the correct name (the one I changed it too).  Yes, I even tried rebooting.

    I want to be able to connect via the Management Studio to the same name that I named it to using the steps in the article above. 

    Do I have to uninstall it and reinstall or is there something else I need to do? 

    More Details...
    1. Server Instance name (BADNAME)
    2. Ran commands to rename to (GOODNAME)
    3. Checked using @@servername and it shows ... GOODNAME.
    4. In Management Studio, it still shows (ever after reboots, etc.) ... BADNAME.
    5. How do I get it to show ... GOODNAME in Management Studio? 

    As always, any help/guidance is appreciated!

    Regards,

    Steve Sad



    Tuesday, November 01, 2005 11:01 PM

Answers

  • You need to reinstall it. There is no instance rename facility for the Database Engine. The steps you followed are for when you rename the computer that SQL Server is running on and you need to match up the internal server name with the new computer name.


    HTH
    Jasper Smith (SQL Server MVP)
    http://www.sqldbatips.com

    Tuesday, November 01, 2005 11:07 PM

All replies

  • You need to reinstall it. There is no instance rename facility for the Database Engine. The steps you followed are for when you rename the computer that SQL Server is running on and you need to match up the internal server name with the new computer name.


    HTH
    Jasper Smith (SQL Server MVP)
    http://www.sqldbatips.com

    Tuesday, November 01, 2005 11:07 PM
  • Jasper,

    Thank you so much for your prompt response.   Here are a FEW ;) more details ...
    The server has the following:
    1. Previous Instance of SQL 2000 (this is the default instance)
    2. Named instance of SQL 2005 (the one we are talking about)
    3. Can I simply REINSTALL SQL2005 .... OR ... <drumroll please> have to UNINSTALL SQL 2005 and THEN reinstall? 
    4. Would a complete uninstall of SQL 2005 mess anything up with my default instance of SQL 2000? 
    5. Hopefully, that makes sense.

    Thanks again for your time,

    Steve
    Tuesday, November 01, 2005 11:19 PM
  • I know this is almost five years old, but this is a pretty high-value target on Google. So for correctness, you CAN rename a SQL Server without uninstalling. Its actually very easy, but with caveats.

    you cannot rename the instance, however.

    http://msdn.microsoft.com/en-us/library/ms143799.aspx
    • Proposed as answer by William Assaf Friday, February 19, 2010 7:23 PM
    Friday, February 19, 2010 7:22 PM
  • Hi,

    We can Rename an SQL Instance.

    For a renamed default instance, run the following procedures:

     

    sp_dropserver <old_name>

    GO

    sp_addserver <new_name>, local

    GO

     

     

    For a renamed named instance, run the following procedures:

    sp_dropserver <old_name\instancename>

    GO

    sp_addserver <new_name\instancename>, local

    GO

     

    Thursday, June 02, 2011 11:39 AM
  • I know this thread is a bit old, but I came across this while looking for something else and was interested because I didn't think it would work to rename an instance (there are physical directories and registry keys that I didn't think would be altered by this procedure for a start.)

    But it seems there's always something new to learn, so I thought I would test this procedure on named instances of Sql Server 2008 and 2012.

    Then after testing I thought I should clarify the issue for anyone who finds this later while looking for a method, tries this procedure and may be confused by the results, so here goes....

    This procedure -

        sp_dropserver <old_name\instancename>

        GO

        sp_addserver <new_name\instancename>, local

        GO

        restart instance


    does not allow you to make this change -

    'old_name\instancename' -> 'old_name\differentinstancename'


    This procedure does allow you to do what the docs say, which is-

    'old_name\instancename' -> 'new_name\instancename'


    That is to say that the 'instancename' component of the name stays the same, while the 'servername' component is modified.  This way a server's name can be changed, and the hosted instances (default and named) can be updated with the new server name. 


    This procedure WILL run successfully in the sense that it does not report any errors, and if you check it, internally the database engine service will report the new name
    for the instance, but to connect to or manage the instance, the new name won't be recognized, and the original instance name continues to be the instance name you'll need to provide for the connection.  Which might be a little confusing if you aren't aware of what's going on, since you'll connect to 'servername\instancename' but select @@servername reports 'servername\differentinstancename,' which is what this operation modified.


    To change the instance name (for 2008 and 2012 as far as I know) you'll need to install a new named instance (with the desired name) and then migrate the user databases to it, then shutdown and remove the old  named instance (if you want to remove it.)  Or at least this is the only supported method I'm aware of.

    Hope this helps anyone who finds it later while researching this topic.


    • Edited by cunninghamcw Thursday, August 18, 2016 3:04 PM clarity
    • Proposed as answer by Katya2 Thursday, September 08, 2016 2:49 PM
    Thursday, August 18, 2016 3:00 PM