How SQL Server decides who waits

Lock Manager Walkthrough

Six short stories about sessions competing for the same rows. Step through each one and watch three views change together: the locks each resource holds, the graph of who waits for whom, and the sys.dm_exec_requests rows you'd see in production.

Sessions

Lock manager

Solid chips are granted locks. Dashed chips are requests waiting in the queue, in order.

Wait-for graph

An arrow points from a waiting session to the session it waits for.

What sys.dm_exec_sessions and sys.dm_exec_requests show

session_idstatuswait_typeblocking_session_idopen_transaction_countisolation

Lock compatibility

Can a requested lock (row) be granted while another session holds the lock in the column?

Glossary