Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server - Full Name
Message
 
 
To
05/03/2008 11:28:20
Takashi Koyama
National Indemnity Company
Omaha, Nebraska, United States
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01298958
Message ID:
01298962
Views:
23
This message has been marked as the solution to the initial question of the thread.
You can use
SELECT @@SERVERNAME
-- or
SELECT SERVERPROPERTY('servername')
See BOL for details

>Hi, I need to run a stored procedure on 3 different servers.
>For this, I need to know which server a stored procedure runs.
>I used
>
>EXEC master..xp_getnetname @cServerName OUTPUT
>
>this works for our development and live server.
>
>However, our development and testing server are in the same machine.
>The configuration is something like this.
>
>Develop: zeta
>Test: zeta\testing.
>
>When I issued EXEC master..xp_getnetname @cServerName OUTPUT on both develop and test, the result is 'zeta'.
>
>Is there a stored procedure which returns the full name like 'zeta\testing'?
>
>Again xp_getnetname returns only upto the machine name.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform