Databases Reference
In-Depth Information
WAITFOR DELAY '00:0:20'
UPDATE tbl_deadlock
SET Comments = 'Simulating Deadlock Event 2.'
WHERE id = 2
At this point, perform the following:
1.
Start the Profiler as configured in Figure 5-11.
2.
Execute code from the connection 1 screen.
3.
Then go to the connection 2 screen and execute the code you have prepared within
20 seconds after the previous step.
Wait for about 20 seconds and you will see the query result from connection 1 completed successfully. In
this example, the SPID number is 53 (see Figure 5-12). However, the query result from connection 2 will
be encountered with a deadlock error message as indicated in Figure 5-13.
Figure 5-12
Search WWH ::




Custom Search