BUG: "Renaming A Server" Topic in SQL Server Books Online is Incomplete

Article translations Article translations
Article ID: 303774 - View products that this article applies to.
This article was previously published under Q303774
BUG #: 354825 (SHILOH_BUGS)
Expand all | Collapse all

SYMPTOMS

The example in the SQL Server 2000 Books Online topic "Renaming a Server" is incomplete. The keyword "local" is missing from the example.

The SQL Server Books Online example contains:

sp_dropserver old_name
go
sp_addserver new_name
go
The correct example is:

sp_dropserver 'old_name' 
go 
sp_addserver 'new_name', 'local' 
go 		

Running the sp_dropserver stored procedure on a server that has associated remote and linked server login entries results in an error message. The error message states that you must remove the logins before you remove the remote or the linked server. To remove all the remote and the linked server logins for a server when you remove the server, use the droplogins argument:

sp_dropserver 'old_name', 'droplogins' 
go 
sp_addserver 'new_name', 'local' 
go

Note After you run the sp_addserver stored procedure, you must restart the SQL Server service for the change to @@SERVERNAME to take effect.

SQL Server Books Online also states the following:

You do not have to run Setup again to reset the computer name.
				
The preceding statement is only true if it is not a virtual server. To rename a virtual server you DO have to uninstall, and then reinstall the virtual server.

CAUSE

Here are a few reasons why the SQL Server SERVERNAME may be NULL or not match the current Microsoft Windows NT machine name:
  • The computer was renamed.

  • An image was taken of the SQL Server computer, and then copied onto another computer.

  • The sp_dropserver stored procedure was run for the local SERVERNAME.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.

MORE INFORMATION

To check if you have a mismatch between your SQL Server servername and the computer's machinename, compare the values from the statements that follow. If the values do not match or if @@SERVERNAME is NULL, you need to rename your SQL Server. For example:
-- get current SQL Server name\instance name
  SELECT @@SERVERNAME
-- get current machine name and instance name
  SELECT SERVERPROPERTY('MachineName'), SERVERPROPERTY ('InstanceName')
				

REFERENCES

For additional information about renaming SQL Server 7.0, click the article number below to view the article in the Microsoft Knowledge Base:
195759 INF: Frequently Asked Questions - SQL Server 7.0 - SQL Setup

Properties

Article ID: 303774 - Last Review: December 2, 2003 - Revision: 4.2
APPLIES TO
  • Microsoft SQL Server 2000 Standard Edition
Keywords: 
kbbug kbpending KB303774

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com