T-SQL Queries to find SQL Server Cluster Nodes and Shared Drives

Posted on Updated on

Here are some SQL Server cluster related T-SQL queries which helps you to find SQL Server Cluster Nodes and their shared drives.

  1. Find name of the Node on which SQL Server Instance is Currently running
    SELECT SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS[CurrentNodeName]

    If the server is not cluster, then the above query returns the Host Name of the Server.

  2. Find SQL Server Cluster Nodes
    a. Using Function

    SELECT * FROM fn_virtualservernodes()

    b. Using DMV

    SELECT * FROM sys.dm_os_cluster_nodes
  3. Find SQL Server Cluster Shared Drives
    a. Using Function

    SELECT * FROM fn_servershareddrives()

    b. Using DMV

    SELECT * FROM sys.dm_io_cluster_shared_drives
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s