I have a SQL Server Always On cluster set up. The cluster name is:
DBCLUSTER001.mydomain.net
It has a few nodes (virtual servers) for fail overs.
Let's say they are:
Node1,
Node2, etc...
To know which node is currently active I run this
SELECT activeServer = @@SERVERNAME;
-- Let's say, it resulted in 'Node1'
What I'm trying to find out that is there a SQL command or query that I can run from the current active node (Node1) to get the cluster name?
It's like if there is something like
SELECT *
FROM <something; a function, table, command>
--my expected output is: DBCLUSTER001.mydomain.net
This is what I'm trying to achieve.
I am looking in to the SQL Server Operating System queries, but so far they all are giving me the Node info only.
Is getting the cluster name actually possible?
I am using SQL Server 2019.