Changing @@servername without a reboot

  • 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 3 posts - 1 through 4 (of 4 total)

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