@@servername and SERVERPROPERTY(ServerName)

  • If I run: select @@servername on a particular SQL Server I get NULL as result.

    If I run: select serverproperty('ServerName') I get 'New Name'.

    In the past, the machine name was changed from 'Old  Name' to 'New Name'. The machine was restarted many times since the name was changed. We didn't have problems due to the name change, but recently I tried the pair of commands above to see what I get and I received the results above. I assumed that somebody dropped the 'Old Name' using sp_dropserver 'Old Name' but forgot to create the new server name using sp_addserver 'New name'. I tried to add the new server name myself but the message was:

    The server 'New Name' already exists.

    However, @@servername shows NULL.

    Can anybody please bring some light into this?

    Thank you, Gabriela.

     

  • Thanks for the link, I just read that before I posted my question. It seems that I did all as described in the article but @@servename shows NULL instead of the new name!!!

    Gabriela

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

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