A Deadlock occurs when Task A waits for Task B, and Task B waits for Task A. The DB kills one to save the other.
| Prevention Strategy | Implementation |
|---|---|
| Access Order | Always update Table A then B, never mix. |
| Snapshot Isolation | READ_COMMITTED_SNAPSHOT ON. |
Use DBCC TRACEON (1222, -1) to capture detailed deadlock graphs in the error log for forensic analysis.
