SQLServerDeadLocks
A procedure to list recent deadlocks on sql server. Another procedure to cause a deadlock.
- pr_DeadlockList - Lists recent deadlocks. Lists which stored procedures/line numbers caused the error.
- pr_Deadlock_Test - Causes a deadlock to happen.
- Open two query windows.
- Execute pr_Deadlock_Test in one of the query windows.
- Execute pr_Deadlock_Test in the other query window.
- Wait a minute or two. One of them should crash with a deadlock error.
- It creates two tables to make this happen, but those tables should be deleted once the test is over.
- You should then see a description of this deadlock if you run pr_DeadlockList.