Thursday, March 7, 2019

MSSQL: Setting trace on deadlock

-- Monitoring deadlock after SQL Server Started.
DBCC TRACEON(1222,-1)
- to turn off
DBCC TRACEOFF(1222,-1)


-- Monitoring deadlock requires SQL Server to start or restart.
Startup Parameter = -T1222





-- Deadlock information will be written into the error log.

Open the error log and search for "deadlock". If there are deadlock around, it should indicate the query and tables a few lines down below.

No comments:

Post a Comment

MSSQL: Getting more detail information for failed jobs.

Often when a job failed, it provides trivial information for diagnostic. In order to expand the detail of the failed job, it can be done th...