Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resetting 'servername' on SQL Server 7.0

Status
Not open for further replies.

StevenK

Programmer
Joined
Jan 5, 2001
Messages
1,294
Location
GB
Following problems with our network we have re-installed SQL Server 7.0 on our server (called COMPANY_SERVER). For the previous couple of weeks we have been using a stand-in server with SQL Server installed (called COMPANY-MAIL-SERVER).
On restoring the SQL Server on COMPANY_SERVER our network team copied the 'Data' folder from the 'MSSQL7' directory on COMPANY-MAIL-SERVER to COMPANY_SERVER (including the 'master' database files. This was unknown to myself until recently. This came to light yesterday when two of the databases started to report errors leading us to the finding that the 'master' database had been copied from one server to another and that the attached databases file-names were pointing to our stand-in server with paths like 'COMPANY-MAIL-SERVER\\MSSQL7\Data\DatabaseName.mdf'. Some of the databases were OK as they had been attached using a file path like 'C:\MSSQL\Data\DatabaseName.mdf' which was valid on both servers. This problem was rectified by detaching databases and attaching the correct ones again.
We have now seen a further problem - the SQL Server on COMPANY_SERVER thinks that it is still called COMPANY-MAIL-SERVER (due to the copying of the 'master' database from server to server). When we issue the command 'SELECT @@SERVERNAME' on our install of SQL Server on our recovered COMPANY_SERVER we get the answer 'COMPANY-MAIL-SERVER' - I'm guessing this is due to an entry in the 'master' database ??
What is the best way to rectify this (setting the server-name to be 'COMPANY_SERVER' as was previously the case) ?
Is this achievable or is the best option to detach all databases, uninstall SQL Server, re-install and then re-attach the databases ?
Thanks in advance.
Steve
 

Look at sp_dropserver and sp_addserver. You should be able to update the server name is the master.dbo.sysservers table with those procedures. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top