I have crafted a query against SQL Server 2012 that looks like the following:
SELECT r.session_id, r.sql_handle, t.text -- more details excluded for brevity
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) t
Now, this helpfully shows me what is running on my server -- and using a query like this I've been able to find things that consuming more resources than they should.
However, it bothers me that (because of the cross apply, I believe) the entries in sys.dm_exec_requests
that don't have a sql_handle value, aren't included. I also worry that at times, the number of requests returned (typically about a dozen) is below what I would expect based on load.
I understand (or think I do) that this is the most finite snapshot in time view I could look at, and SQL can only do so many things at once, but I also wonder, what is my query missing to present me a picture of "what is using my server right now"?