Skip to content

Instantly share code, notes, and snippets.

@vkhazin
Created November 2, 2017 22:37
Show Gist options
  • Save vkhazin/26e640e813d7564c9e69e27dd2c18833 to your computer and use it in GitHub Desktop.
Save vkhazin/26e640e813d7564c9e69e27dd2c18833 to your computer and use it in GitHub Desktop.
--https://blog.sqlauthority.com/2009/01/07/sql-server-find-currently-running-query-t-sql/
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