Dropping an alias caused @@servername to return NULL
Posted on 2009-05-04
I was working on adding a replication distribution for a SQL 2005 server. It mentioned an old alias as the server name. I ran sp_deleteserver for the alias, but it was set to the id of 0 in sp_helpserver. Now when I try to set up replication, there is no server name assigned. the correct name has an id of 2. attempts at using sp_dropserver 'correct_name' cause an error
Msg 15190, Level 16, State 1, Procedure sp_dropserver, Line 56
There are still remote logins or linked logins for the server
i've tried to use sp_addserver 'correct_name','LOCAL','duplicate_ok' to set id 0, but it only changed the value of correct_server to 1 in "select * from sys.servers" . select @@servername is still NULL.
how can I safely change the name of the server to the entry listed at ID 1 of sp_helpserver without causing any loss of login information in order to keep the name as well as enable @@servername so i can turn on replication