SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

Renaming a SQL Server

By Brian Knight, 2004/09/17 (first published: 2001/04/11)

Total article views: 57729 | Views in the last 30 days: 219

Renaming a server can be a mystery in SQL Server. The symtoms that SQL Server displays after you rename a server makes it look like you made a bad mistake. There are registry entries and system table records littered throughout your system that reflect the server's name. In this brief article, I'll show you a few tips on how to quickly change your server's name and hopefully save a few headaches along the way.

Renaming a SQL Server 7.0 Machine

SQL Server 7.0 is the most difficult scenario for renaming your server since you must take an additional step that is an act of faith. After you change the server name and reboot, SQL Server will complain about not being able to start. This is usually where you go and call Microsoft Support or post to a newsgroup. Before you do that though, rerun setup. This is the scary part the first time you do this. The setup Installshield will tell you that it is going to upgrade your system. This will change the registry entries. After that, reboot one more time then connect to the new server name in Query Analyzer. Run the following command:

sp_dropserver 'old server name'
sp_addserver 'new server name', 'local'

Finally, delete the entry in Enterprise Manager for the old server name and then you’re done.

Renaming a SQL Server 2000 Machine

SQL Server 2000 is much easier. After you change the server name and reboot SQL Server will automatically detect that you've changed the server name and then "fix itself". All you'll have to do is connect to the new server name in Query Analyzer and run the following command:

sp_dropserver 'old server name' 
sp_addserver 'new server name', 'local'

Delete the entry in Enterprise Manager for the old server name and then you’re golden. You will have to stop and start the SQL Server service to complete the process.

By Brian Knight, 2004/09/17 (first published: 2001/04/11)

Total article views: 57729 | Views in the last 30 days: 219
Your response
 
 
Related tags
 
 
Contribute

Free registration required...

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Login (existing users)

Login

Email:   Password:   Remember me: Forgotten your password?

Register (new users)

Register

Email:   Password:
Confirm:

Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

Steve Jones
Editor, SQLServerCentral.com