Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Administration - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 6525

Determine Which Server is Currently Active for Availability Groups

$
0
0
I want two write a small script to determine which is the currently active (primary) server in the AG. Right now, I see that using SELECT * FROM SYS.dm_hadr_availability_replica_states I can determine the role. However, when the server goes down and switches to the secondary node, I don't believe that the role changes (or does it?). How do I determine which is the active node?

Viewing all articles
Browse latest Browse all 6525

Trending Articles