Changing @@servername without a reboot

  • All

    I inherited a 2005 SQL Server instance.   The Machine is running a high availability system and cannot be taken down. 

    Current Machine Name SQL06AR

    The problem is that before I got the machine was renamed, and the SQLServer ( select @@servername ) thinks it is still the old instance SQL05M3. 

    Ok, so I checked the defined servers.... select * from sys.servers and sure enough the old server name is there.  So I dropped the old SQL Server sp_dropserver SQL05M3 and added the newly named one  sp_addserver SQL06AR, 'LOCAL'.

    Everything looks good when I do a sp_helpserver but when I do the select @@servername the old server name still appears.   

    I have tried to do a reconfigure, or some thing else....I know the issue will resolve its self if do a re-boot, but the application is 24X7 high available and I cannot schedule a window for a week or two.

    Anyone have any ideas?

    Eric Peterson

       

  • you should not have to do a reboot, I believe simply stopping and starting the SQL service is all that is required. when the service starts, all the @@variables and SET options are loaded fresh.

    I tested this to be sure:

     sp_dropserver DAISY

     sp_addserver WONDERFUL, 'LOCAL'

    [stopped and started the service]

    select @@SERVERNAME returned WONDERFUL

     sp_dropserver WONDERFUL

     sp_addserver DAISY, 'LOCAL'

    [stopped and started the service]

    select @@SERVERNAME returned DAISY

    it's a lot easier to stop and start teh service for a few seconds than a reboot.

    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!

  • Thanks

    The reboot of the service or the server is what I am trying to avoid.    lol

    Looks like I am going to have a window this weekend as my systems group is applying some new patches, and wants to take all apps down for a few minutes. 

    Thanks again

    Eric

  • Most of the configurations are dynamic in SQL2005 but this server name change is not dynamic...

    May be in next release

     

    MohammedU
    Microsoft SQL Server MVP

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply