@@server Returns NULL ??

  • Hello,

    MSSQL 2000 w/SP3

    When I SELECT @@servername, the result is NULL.

    When I SELECT CONVERT(char(20), SERVERPROPERTY('servername')), I get the name of the database server that I am looking for.

    Any ideas why @@servername returns NULL? And how/what do I change to have a value returned?

    Many thanks. Jeff

  • jeff,

    have you (or anyone else) recently changed the name of your sql server?

    @@servername refers to the network name of the sql server, where as the servername property of SERVERPROPERTY is explicitly set at installation time. see BOL 'SERVERPROPERTY' for a better explanation of that.

    ll

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

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