Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

List All Currently Running Queries

DZone's Guide to

List All Currently Running Queries

·
Free Resource
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:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}