Assume that you enable the Query Store feature for a database in an instance of SQL Server 2016. When you query the query plan by using join operations, the query_plan column in the query result contains unusual characters.
For example, you join sys.query_store_plan to another view, as in the following query:
SELECT qt.query_sql_text, q.query_id, qt.query_text_id, p.plan_id, p.query_plan
FROM sys.query_store_query_text AS qt
INNER JOIN sys.query_store_query AS q ON qt.query_text_id = q.query_text_id
INNER JOIN sys.query_store_plan AS p ON q.query_id = p.query_id
In this situation, the query_plan column in the query result contains characters such as the following:
The fix for this issue is included in the following cumulative update for SQL Server:
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:
To work around this issue, do not join sys.query_store_plan to another view when you try to retrieve query_plan. Instead, to retrieve query_plan for a given plan_id, run a separate query for that plan_id that resembles the following:
select plan_id, query_plan
where plan_id = plan_id
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.