DBAtlas · Database operations atlas

1205: Transaction (Process ID) was deadlocked on lock resources with another process and has been chosen as the deadlock victim

SQL Server

What does it mean?

Two or more transactions each wait for locks held by the other (a deadlock). To break the cycle, SQL Server picks one transaction as the victim and rolls it back.

Why does it happen?

Transactions locking tables/rows in different orders, long-running transactions, wide scans caused by missing indexes, lock escalation and high concurrency are the typical causes.

How to fix it

Catch error 1205 in the application and retry the transaction automatically. Access objects in the same order in every transaction and keep transactions short. Examine the deadlock graph: use Extended Events (the system_health session) or trace flag 1222 for details. Add appropriate indexes to reduce scanning and locking. If needed, evaluate the READ COMMITTED SNAPSHOT (RCSI) isolation level.

Open in DBAtlas →

More from this engine