SQLTeam.com | Weblogs | Forums

Runtime Error-[SQL Server]Transaction (Process ID 238)


Transaction (Process ID 59) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction
Error Code: 1205
FROM dbo.PriceList_Class WHERE PLGUID in ( Select GUID
from dbo.cMat_PriceList WHERE GUID in

Hi i got the above error. I am looking for some best solutions to avoid those errors .

  1. Ensure index is available on PLGUID column
  2. Deadlocks typically occurs when several long-running transaction execute concurrently. Keep transactions as short as possible


No, that is not true.

From Deadlocks

A deadlock occurs when two or more tasks permanently block each other by each task having a lock on a resource which the other tasks are trying to lock. The following graph presents a high level view of a deadlock state where:

  • Task T1 has a lock on resource R1 and has requested a lock on
    resource R2

  • Task T2 has a lock on resource R2 and has requested a lock on
    resource R1 .

  • Because neither task can continue until a resource is available and
    neither resource can be released until a task continues, a deadlock state exists.


I meant same guid is processed in different transaction at a time. I hope without second transaction at the time deadlock cannot happen