Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 renaming SQL server

Author  Topic 

AgaK
Yak Posting Veteran

86 Posts

Posted - 2010-12-06 : 13:45:49
Hi

One of our SQl servers was renamed by a sysadmin and the sp_helpserver and select @@servername doesn't show the same name. The sp_helpserver shows the new name but select @@servername is still showing the old one.

Any ideas how it can by fixed?

thank you

AK

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-12-06 : 14:01:03
Look up sp_dropserver and sp_addserver in Books Online.
Go to Top of Page

avinashily
Starting Member

10 Posts

Posted - 2010-12-08 : 10:07:22
hi,

get current SQL Server name\instance name
SELECT @@SERVERNAME
and also

get current machine name and instance name

SELECT SERVERPROPERTY('MachineName'), SERVERPROPERTY ('InstanceName')

if from both the queries you observe that the names are different you need to change your sql server name in sql server instance
for that you need to use.

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

this would work fine.

// it is always suggested to do it first on the test server then implement on production server//
Go to Top of Page
   

- Advertisement -