How to change to the current server name in the 6.x master database (ISQL/w)

To change to the current server name in the 6.x master database

  1. Start Microsoft® SQL Server™ in minimal configuration mode. In a command prompt window, from the \Mssql\Binn directory, run:

    sqlservr -f

  

  1. On the Start menu, point to Programs /Microsoft SQL Server 6.x, and then click ISQL/w.
  2. Enter the sa password; then click Connect.
  3. Execute SELECT @@SERVERNAME to retrieve the former server name.
  4. Execute sp_dropserver to drop the former server.
  5. Execute sp_addserver to add the current server.
  6. Stop SQL Server. In the command prompt window, press Ctrl+C.
  7. Restart SQL Server.
  8. Execute SELECT @@SERVERNAME to verify the current server name.
Examples

--Start SQL Server in minimal configuration mode.

--Retrieve the former server name.

SELECT @@SERVERNAME

--Drop the server returned from the previous select.

sp_dropserver 'SERVER6X'

--Add the current server.

sp_addserver 'SERVER70', local

--Stop SQL Server.

--Restart SQL Server in minimal configuration mode.

--Verify the current server name.

SELECT @@SERVERNAME

  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.