Skip to content

Instantly share code, notes, and snippets.

@richardbasile
Created February 16, 2018 14:12
Show Gist options
  • Save richardbasile/63c8fee19f07501dcab52e1f28c9f47d to your computer and use it in GitHub Desktop.
Save richardbasile/63c8fee19f07501dcab52e1f28c9f47d to your computer and use it in GitHub Desktop.
SQL Server - Processes
SELECT spid, kpid, blocked, d.name as dbname, open_tran, status, hostname, cmd, login_time, loginame, net_library
FROM sys.sysprocesses p
LEFT JOIN sys.databases d ON p.dbid=d.database_id
ORDER BY d.name, loginame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment