Over a million developers have joined DZone.

List All Currently Running Queries

·
Sql Server 2005 - List all currently running queries

Note: Run on the master table


SELECT st.text, r.session_id, r.status, r.command, r.cpu_time, r.total_elapsed_time
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS st
order by total_elapsed_time desc
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}