title: Extended events, template Count Query Locks: query returns 0 rows
body: <p>I am learning Extended Events basics from Jonathan Kehayias's course. I have problem with some query. In Microsoft SQL Server Management Studio I created (Extended Events) session. I downloaded database AdventureWorks2012 and script generating workload on this database. Script is available here <a href="https://www.sqlskills.com/blogs/jonathan/the-adventureworks2008r2-books-online-random-workload-generator/" rel="nofollow noreferrer">https://www.sqlskills.com/blogs/jonathan/the-adventureworks2008r2-books-online-random-workload-generator/</a>. I used template Count Query Locks available in Extended Events templates. In course the following query is used:
  SELECT * FROM sys.dm_exec_query_stats
  WHERE CAST(query_hash AS BIGINT) = 13579191135410749623.
  This last number is taken from histogram from column value: I click on histogram and choose View Target Data). Here is screen from SQL Server Management Studio: <a href="https://i.stack.imgur.com/uuxt3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uuxt3.png" alt="enter image description here"></a>
  In my case this query returned 0 rows. I do not understand why. What could be the problem?</p>