1. Recognise the symptoms
Blocking is not the same as a slow query. A blocked query is not working; it is waiting for a lock held by another session. Typical signs are timeouts that appear at the same times of day, operations that hang and then finish all at once, and complaints that come from many users simultaneously.
Before changing anything, write down when the problem occurs and which operations are affected. That context is often what connects the database evidence with a specific business process.
2. See who is waiting and for whom
While the problem is happening, SQL Server's dynamic management views show which requests are blocked and which session blocks them:
SELECT r.session_id, r.blocking_session_id, r.wait_type,
r.wait_time, r.status, t.text AS running_sql
FROM sys.dm_exec_requests AS r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) AS t
WHERE r.blocking_session_id <> 0;3. Find the head of the chain
Blocking usually forms a chain: session A blocks B, and B blocks C. Fixing C or B does nothing. You need the head blocker: the session that blocks others but is not blocked itself. Very often it is a sleeping session with an open transaction, for example an application that started a transaction and never committed it:
SELECT s.session_id, s.status, s.login_name, s.host_name,
s.program_name, s.open_transaction_count,
t.text AS last_sql
FROM sys.dm_exec_sessions AS s
JOIN sys.dm_exec_connections AS c ON c.session_id = s.session_id
OUTER APPLY sys.dm_exec_sql_text(c.most_recent_sql_handle) AS t
WHERE s.session_id IN (SELECT blocking_session_id FROM sys.dm_exec_requests
WHERE blocking_session_id <> 0)
AND s.session_id NOT IN (SELECT session_id FROM sys.dm_exec_requests
WHERE blocking_session_id <> 0);4. Understand why the lock is held so long
Once the head blocker is known, the question becomes why it holds its locks for so long. The most common causes I see:
- A long transaction that does extra work (or waits for the user) before committing.
- A missing index, so an UPDATE or DELETE scans many rows and locks far more than it needs to.
- Implicit transactions or connection pool settings that leave transactions open.
- Different procedures updating the same tables in a different order, which also leads to deadlocks.
- A stricter isolation level than the process really needs.
5. Fix the cause, then verify
Killing the blocking session ends the incident but does not prevent the next one. Lasting fixes are usually a supporting index, a shorter transaction scope, a consistent order of table access or a corrected application transaction. Read Committed Snapshot Isolation can greatly reduce reader–writer blocking, but it changes behaviour and increases tempdb usage, so it should be tested first.
After the change, repeat the business operation that used to hang and confirm that waits disappeared, not only that the query looks faster in isolation.
6. Catch the next occurrence automatically
Blocking often happens when nobody is watching. Setting the 'blocked process threshold' option and capturing the blocked process report with Extended Events records who blocked whom, with the SQL text, even at 3 a.m. That turns the next incident into a five-minute analysis instead of a guess.