If you were like me, you would know your AG configuration by heart. However, what if you get busy with increasing responsibilities in other areas, projects etc.? Therefore, you do not just want to rely on your memory. On the other hand, maybe you want to simply collect snapshot of your configuration every now and then or have it documented before a major upgrades, for your junior DBAs, new hire etc... Alternatively, maybe you just started working for a new employer or a new client. Whatever is your reason, here is a DMV query to gather the information. SELECT ag . name ag_name , ar . replica_server_name replica_server , CASE WHEN hdrs . is_primary_replica = 0 AND hdrs . replica_id = ar . replica_id THEN 0 ELSE 1 ...