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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing ServerName

Status
Not open for further replies.

NWChowd

Programmer
May 26, 2002
84
US
I am unsure of how to modify the servername on a SQL 7.0 machine.

The problem is that when I execute &quot;SELECT @@SERVERName&quot;, it returns <wrongservername>, when really I should be getting <rightservername>. The physical machine is named <rightservername>. I think at one time, my predecessors had name the server <wrongservername>, and then decided to change the server name, but did not do a complete job.

This is an issue because I am trying to run some diagnostics software that is trying to reference the server as <rightservername>, but is seeing <wrongservername>, and thus cannot connect to <rightservername>.

Also, will changing the servername have potential side effects? Nothing that I am aware of references <wrongservername> on our network or in code or anythignlike that.

Thanks in Advance,
DMill






======================================
&quot;I wish that I may never think the smiles of the great and powerful a sufficient inducement to turn aside from the straight path of honesty and the convictions of my own mind.&quot;
-David Ricardo, classical economist
======================================
 
Change @@SERVERNAME by using sp_addserver and then restarting SQL Server.

The server name is stored in sysservers in the master table. i know when we rename servers, i have to change this manually.

If you look in it, the old one is proably listed. just change it to rightservername
 
Thanks, Corran007.

I noticed that the existing DB Maintenance Plans reference <wrongservername> on our server. If I change the server name in the sysservers table to <rightservername>, will the DB Maintenance Plans still function? or will they try to reference <wrongservername> still?


Thanks!

DMill

======================================
&quot;I wish that I may never think the smiles of the great and powerful a sufficient inducement to turn aside from the straight path of honesty and the convictions of my own mind.&quot;
-David Ricardo, classical economist
======================================
 
Drop the old server first

sp_dropserver <wrongserver name>

then add the new one

sp_addserver <rightNewName>,'local'

You need the local paremeter to identify this name as the local server and then select @@servername will return the right name.

Not sure about the maintenance plans though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top