Skip to content

Instantly share code, notes, and snippets.

@mvodep
Last active March 2, 2019 07:56
Show Gist options
  • Save mvodep/69434cde71655f130059c2ea3a0297d4 to your computer and use it in GitHub Desktop.
Save mvodep/69434cde71655f130059c2ea3a0297d4 to your computer and use it in GitHub Desktop.
SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time,
DB_NAME(req.database_id)
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