Database Reference
In-Depth Information
Figure 21-3. A SQL Server instance's Properties dialog box showing the Startup Parameters tab
3.
Type -T1222 in the “Specify a startup parameter” text box, and click Add to add trace flag 1222.
4.
Click the OK button to close all the dialog boxes.
These trace flag settings will be in effect after you restart your SQL Server instance.
Analyzing the Deadlock
To analyze the cause of a deadlock, let's consider a straightforward little example. First, make sure you've turned on
the deadlock trace flag 1222 and created an Extended Events session that uses the xml_deadlock_report event. I'm
using both methods for demonstration purposes. You would normally need only one method to capture deadlock
information.
In one connection, execute this script:
BEGIN TRAN
UPDATE Purchasing.PurchaseOrderHeader
SET Freight = Freight * 0.9 -- 10% discount on shipping
WHERE PurchaseOrderID = 1255;
 
Search WWH ::




Custom Search