FIX: Access violation for DMV queries run against a distributed availability group in SQL Server

Applies to: SQL Server 2016 Enterprise CoreSQL Server 2016 EnterpriseSQL Server 2016 Developer


Assume that you use distributed availability groups in Microsoft SQL Server 2016 and 2017. When you query the sys.dm_hadr_availability_group_states or sys.availability_groups dynamic management view (DMV) against a distributed availability group, an access violation occurs.


This fix is included in the following cumulative updates for SQL Server:

Cumulative Update 4 for SQL Server 2017 

Cumulative Update 6 for SQL Server 2016 Service Pack 1


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.


Learn about the terminology Microsoft uses to describe software updates.