Home Forums SQL Server 2005 Administering @@servername and serverproperty('servername') gives different values RE: @@servername and serverproperty('servername') gives different values

  • The networkname was changed to 'SQL2K5SWPROD'. But SQL Server was installed after the name change happened. So I reckon this should show the new name for @@SERVERNAME as well.

    I tried

    sp_dropserver 'SQL2K5SWSRV', null

    Command(s) completed successfully.

    sp_helpserver

    Msg 15205, Level 16, State 1, Procedure sp_helpserver, Line 17

    There are no servers defined.

    sp_addserver 'SQL2K5SWPROD','LOCAL'

    Command(s) completed successfully.

    sp_helpserver

    namenetwork_name

    ----------------------------

    SQL2K5SWPRODSQL2K5SWPROD

    After executing the commands the @@SERVERNAME should be returning 'SQL2K5SWPROD', but the it still returns the incorrect value ['SQL2K5SWSRV']

    Any suggestion to get this corrected without a downtime would would be of much help.

    Cheers,

    Imran.