I have used the following query to find the currently Running Query on my SQL 2008 R2.
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_h
andle) AS sqltext
1. For the session_id, is it equivalent to the sp_id generated from 'sp_who2'. If not, how can I tell who is running the query ?
2. for cpu_time and total_elapsed_time, is it an accumulated value. ie. will it included the value for those completed sql tasks ?
3. for unit used in cpu_time & total_elapsed_time, does it measure in ms & s respectively ?
4. Does the result come from the previous sql statement is the same as the one in the below url ?