Skip to content

Instantly share code, notes, and snippets.

@seven1m
Created March 17, 2010 16:59
Show Gist options
  • Save seven1m/335453 to your computer and use it in GitHub Desktop.
Save seven1m/335453 to your computer and use it in GitHub Desktop.
Find blocking processes on SQL Server 2005
# I don't pretend to understand this query,
# but it seems to be a good list of processes
# that are "blocking" other processes and hosing the server.
select * from sys.dm_os_waiting_tasks where session_id != @@spid and session_id > 50 and blocking_session_id < session_id order by wait_duration_ms desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment