• i believe sp_addserver is used internally when you add a linked server.

    having just replaced a server recently, this tidbit might be of some help.

    we create a machine named APP-TEMP to replace APP-PRODUCTION; the usual newer Operating system and newer version of SQL was used.

    we migrated everything we needed to...logins, jobs, linked servers, credentials,database mail settings ..everything via script.

    we toggled all the databases to read only on the APP-PRODUCTION; then we backed up and restored the databases on the new server.

    we turned off the original APP-PRODUCTION box, and then renamed APP-TEMP to APP-PRODUCTION.

    at this point, other machines could connect to the replace ment server.

    sys.servers serverid= 0 is supposed to be the name of the server itself, and of course at this point it still says APP-TEMP, as well as when you select @@SERVERNAME.

    we ran this command to reset the name:

    EXEC sp_dropserver 'APP-TEMP'

    EXEC sp_addserver 'APP-PRODUCTION', 'local'

    looking at that same @@SERVERNAME / name from sys.servers where server_id = 0 was still the old value.

    we restarted the SQL service, and only then did the name change for us...i was under the impression the renaming was supposed to be instant, but that's what we saw here.

    we then had to stop and start the service, and at that point sys.servers and @@servername was correct.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!