What sort of exec requests don't have a sql handle? (sys.dm_exec_requests)
The issue with your current query is that you are only looking for queries that could be running at that very moment. To get a good full picture of your server state, you could try to run SQL Server Profiler or check for connections with a built-in stored procedure likesp_who
. These approaches are more complicated and time-consuming than using a stored procedure that's already been developed and tested by other DBAs.
I suggest that you install Adam Machanic's free stored procedure, called sp_whoisactive
. The most recent version, should be sufficient to help you dig into activity on your server. This procedure will also give you more detailed information than writing a query referencing one or two DMVs. From the documentation, sp_whoisactive
uses 15 DMVs.
What sort of exec requests don't have a sql handle? (sys.dm_exec_requests)
Sql_handle
is a hash value which identifies SQL text of the batch/query being submitted to the server. Text can be NULL for encrypted objects so this can cause sql_handle
to be NULL