In Microsoft SQL Server, when you try to monitor cached query plans by using extended events (xEvents) and dynamic management views (DMVs), such as sys.dm_exec_requests and sys.dm_exec_query_stats, it is very difficult to correlate the cached query plans together.
This issue occurs because the data types of the Query_hash and Query_plan_hash columns differ between DMVs and xEvents. The Query_hash and Query_plan_hash columns are defined as Varbinary data type in DMVs (sys.dm_exec_requests and sys.dm_exec_query_stats). In xEvents, the columns are defined as UINT64 data type.
Service pack information for SQL Server
This update is fixed in the following service packs for SQL Server:
Service packs are cumulative. Each new service pack contains all the fixes that are in previous service packs, together with any new fixes. Our recommendation is to apply the latest service pack and the latest cumulative update for that service pack. You do not have to install a previous service pack before you install the latest service pack. Use Table 1 in the following article for finding more information about the latest service pack and latest cumulative update.
After you install this update, two additional columns defined as INT64 data type are added: Query_hash_signed and Query_plan_hash_signed. These make it easier to join data between the DMVs and xEvents (such as rpc_completed and sql_batch_completed).
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Learn about the terminology that Microsoft uses to describe software updates.