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 2000 Forums
 SQL Server Administration (2000)
 Renaming a server

Author  Topic 

JaybeeSQL
Posting Yak Master

112 Posts

Posted - 2012-07-16 : 11:48:42
Hi all,

I'm starting to go around in circles on this rename, apparently it's a fresh server and hasn't been previously renamed, here's the code I'm using;


--Get the current name of the SQL Server instance for later comparison.

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

Resulting message - OurMachineName1, Null

--Remove server from the list of known remote and linked servers on the local instance of SQL Server.
EXEC master.dbo.sp_dropserver [OurMachineName1]

Resulting message - The server "OurMachineName1" does not exist. Use sp_helpserver to show available servers.

--Define the name of the local instance of SQL Server.
EXEC master.dbo.sp_addserver [OurMachineName2], local

Resulting message - the server "OurMachineName2" already exists.


All well and good so far, HOWEVER....

--Get the new name of the SQL Server instance for comparison.
SELECT @@servername

Resulting message - "OurMachineName1"

I'm out of ideas, can anyone help here? I want to load some db's onto this new server but if I go tinkering with the name AFTERWARD it'll likely break something.

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-07-16 : 12:09:38
Have you restarted the machine?


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

JaybeeSQL
Posting Yak Master

112 Posts

Posted - 2012-07-16 : 12:35:07
Restarted the service, which then yielded the desired result in @@servername, but not rebooted.
Go to Top of Page
   

- Advertisement -