Skip to content

Instantly share code, notes, and snippets.

@danblank000
Created August 22, 2017 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danblank000/98c155d4ad58f1af9fbe123cf0f4b066 to your computer and use it in GitHub Desktop.
Save danblank000/98c155d4ad58f1af9fbe123cf0f4b066 to your computer and use it in GitHub Desktop.
See what queries are currently running
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
--Find who is responsible
EXEC sp_who '281'
--Stop query
KILL 401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment