August 3, 2007 at 6:32 am
Hi all,
How do I find the physical name of a server registered in EM?
Thanks,
Jaybee
August 3, 2007 at 7:01 am
usually select @@SERVERNAME wil return what you are looking for. if it were a n instance, like MYSERVER\SQL2005, it would be the part before the slash.
Lowell
August 3, 2007 at 8:00 am
Jay Bee
Select SERVERPROPERTY('MachineName')
will work unless it's a clustered server. In SQL 2005 you can find out the name of the clusternode a server is running on with:
Select SERVERPROPERTY('ComputerNamePhysicalNetBIOS')
Markus
[font="Verdana"]Markus Bohse[/font]
August 3, 2007 at 10:47 am
For SQL Server 2000, use this SQL
selectcast( serverproperty ('machinename') as nvarchar(128) )as MachineName
, cast( serverproperty (IsClustered) as nvarchar(1) )as ClusteredInd
Where:
MachineName values are:
For a cluster, the virtual SQL Server Name
For a non-clustered, the computer name
ClusteredInd will have values of:
1 = Clustered.
0 = Not Clustered.
NULL = Invalid input, or error.
To get a list of the nodes of a cluster, use this SQL
selectcast( serverproperty ('machinename') as nvarchar(128) )as machinename
, NodeName
from ::fn_virtualservernodes()
For SQL Server 2000, there does not appear to be any SQL statement to determine which cluster node is running SQL Server except to use the Windows cluster adminstrator tool.
SQL = Scarcely Qualifies as a Language
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply