Contents
How to enable Trace Flag 1204 and 1222?
There are two ways to enable global trace flags. You can enable the trace flag when SQL Server starts by using the -T1222 startup option, or you can use the DBCC TRACEON(1222,-1) command after SQL Server has started.
How do you use DBCC Traceon?
To turn off a global trace flag, use DBCC TRACEOFF with the -1 argument. Using the -T startup option to specify that the trace flag be set on during startup. The -T startup option enables a trace flag globally. You cannot enable a session-level trace flag by using a startup option.
What is flag in SQL database?
You use database flags for many operations, including adjusting SQL Server parameters, adjusting options, and configuring and tuning an instance. When you set, remove, or modify a flag for a database instance, the database might be restarted. The flag value is then persisted for the instance until you remove it.
What is the DBCC trace flag 1204, 1222?
Trace Flag 1204:- Focused on the nodes involved in the deadlock. Each node has a dedicated section, and the final section describes the deadlock victim. Trace Flag 1222:- Returns information in an XML-like format that does not conform to an XML Schema Definition (XSD) schema. The format has three major sections.
How to produce deadlock information with trace flag 1222?
Trace Flag 1222 – Produce deadlock information in XML format Using Trace Flag 1222 We can make this ON in two ways, first we can use query editor window with “DBCC TRACEON (1222, -1)” command. But remember that this trace flag will not capture the deadlock information on next start of SQL Server if we start it from T-SQL DBCC command.
How to enable trace flag 1204 in SQL Server?
Use above command to enable Trace Flag 1204. Again create a deadlock situation as above and once you will get error message of deadlock, go to Object Explorer -> Management -> SQL Server Logs. Have a look on the output of trace flag 1204 below. All the details related to Trace Flag 1204 has been captured in Error Log.
Where can I find the trace flag 1222?
To see the TRACE FLAG 1222 Output, right click on top “Current – Current Date Time” file and click on “View SQL Server Log”. Log file viewer window will appear. Have a look on the result of trace flag 1222 below. In above figure you can see, all the details related to deadlock has been captured in Error Log.