@@servername returns null

  • I'm running SQL2000 and when I check for 'select @@servername' it returns null. I've tried using sp_addserver 'servername, 'local' and restarting SQL Server but had no luck. When I query the sysservers table there is one record and it has the correct srvname. The only thing I can see amiss in the table is that the srvid is 1 rather than 0.

    Any suggestions or am I looking at a re-install of SQL Server?

  • BOL says to shut the server down and restart after doing the sp_addserver. Maybe this means the box rather than the SQL service? Worth a try.

    Cheers,

    - Mark


    Cheers,
    - Mark

  • try

    select serverproperty('ServerName')

    best regards,

    chris.

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

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