|
JaybeeSQL
Yak Posting Veteran
77 Posts |
Posted - 07/16/2012 : 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. |
Edited by - JaybeeSQL on 07/16/2012 11:49:35
|
|