How to access server name in sql server 2005

  • hi,

    i am using stored procedure which put data in another table fron different database.

    so i am using servername.databasename.dbo.tablename.

    if I am change the servername then i have to edit the Stored procedure.

    Is there any way to access server name.so that if server name is chane then also i dont have to change stored procedure.

    Like in c we use #define where we change value of variable that is reflected in whole program.

  • Obviously the variable @@servername holds the details of the server name, so you can use that perhaps?

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

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