Physical name of server

  • Hi all,

    How do I find the physical name of a server registered in EM?

    Thanks,

     

    Jaybee

  • 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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]

  • 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