September 2007
Intermediate to advanced
448 pages
13h 52m
English
A deadlock in SQL Server consists of two threads that block each other, and each is waiting on the other to finish. This type of mutual blocking is commonly called a cycle, because you have two blockers in a kind of inverse relationship. SQL Server’s deadlock monitor process periodically checks for such cycles and chooses one of the tasks as a deadlock victim. The deadlock victim’s session has its batch aborted, its transaction rolled back, and it receives the following 1205 error message template (from the master.dbo.sysmessages system table):
Transaction (Process ID %d) was deadlocked on %.*ls resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
SQL Server will insert ...
Read now
Unlock full access