SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Renaming a server
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

JaybeeSQL
Yak Posting Veteran

77 Posts

Posted - 07/16/2012 :  11:48:42  Show Profile  Reply with Quote
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.

Edited by - JaybeeSQL on 07/16/2012 11:49:35

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3328 Posts

Posted - 07/16/2012 :  12:09:38  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
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
Yak Posting Veteran

77 Posts

Posted - 07/16/2012 :  12:35:07  Show Profile  Reply with Quote
Restarted the service, which then yielded the desired result in @@servername, but not rebooted.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000