@@servername

  • Hi

    I am getting a wrong servername when i use @@servername

    Its giving me wrong servername as 'API-SERVER'

    but when i use SERVERPROPERTY ('Servername') its giving the correct servername. the actual name is 'SQL-Db-2k'

    I tried sp_dropserver and sp_addserver but still giving the wrong servername when i used @@servername

    I even checked SysServers it has the correct name.

    I dont know how to correct this servername when @@servername is used.

    Its not causing any problems on the serverside but in some applications (sps) we use @@servername.

    any ideas???

  • Have you restarted the SQL Service since running sp_dropserver and sp_addserver?


    TL Broadbent

  • No I did not restarted the server. I will restart the server and check again

    Thank you

     

  • Post your feedback, after your restart.  I have to do the same thing to one of my server.

  • I just renamed three of my servers, since their SQL server names were different from the windows server names. You have to restart the SQL server for the changes to take effect. Remember to specify sp_addserver with the local option.

  • I restarted the server last night.

    Its working now. I am getting the correct servername.

    Thank you.

Viewing 6 posts - 1 through 5 (of 5 total)

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