Skip to content

Instantly share code, notes, and snippets.

@imbgar
Created October 30, 2019 01:13
Show Gist options
  • Save imbgar/371e8971935161422eb1490a82c05192 to your computer and use it in GitHub Desktop.
Save imbgar/371e8971935161422eb1490a82c05192 to your computer and use it in GitHub Desktop.
SQL Server currently running queries
SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment