getting the server name ?

  • Hi,

    Is there any function to get the current server name, as the default value when user enter anything in a table.

    Thanx

  • @@servername function returns the computer's name that is running SQL Server

    SERVERPROPERTY('servername') function returns SQL Server's name

    Regards,Yelena Varsha

  • Thanx, but I want to use the servername as the default value in my table. but when i used this statement 'select @@servername ' as a default value, it shows same string as the default value in the table.

    please help me in this regard.

    noman

  • you need to use dynamic sql to insert a variable into a query string.

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

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