Tuesday, March 6, 2012

Another great usage of cross apply - all running queries


select r.session_id, r.status,r.start_time,r.command,s.text
from sys.dm_exec_requests r
cross apply  sys.dm_exec_sql_text(r.sql_handle) s
where r.status ='running'

No comments:

Post a Comment