|Message:||Transaction (Process ID %d) was deadlocked on %.*ls resources with another process and has been chosen as the deadlock victim. Rerun the transaction.|
Resources are accessed in conflicting order on separate transactions, causing a deadlock. For example:
The system will detect this deadlock and will choose one of the transactions involved as a ‘victim’ and will issue this message, rolling back the victim’s transaction. For more information about deadlocks, see Deadlocking in SQL Server 2005 Books Online.
Execute the transaction again. You can also revise the application to avoid deadlocks. The transaction that was chosen as a victim can be retried and will likely succeed, depending on what operations are being executed simultaneously.
To prevent or avoid deadlocks from occurring, consider having all transactions access rows in the same order (Table1, then Table2); this way, although blocking may occur, a deadlock will not occur. For more information about actions to take see “Detecting and Ending Deadlocks” in SQL Server 2005 Books Online.