DBCC TRACESTATUS (Transact-SQL)
Displays the status of trace flags.
The following table describes the information in the result set.
Column name |
Description |
---|---|
TraceFlag |
Name of trace flag |
Status |
Indicates whether the trace flag is set ON of OFF, either globally or for the session. 1 = ON 0 = OFF |
Global |
Indicates whether the trace flag is set globally 1 = True 0 = False |
Session |
Indicates whether the trace flag is set for the session 1 = True 0 = False |
DBCC TRACESTATUS returns a column for the trace flag number and a column for the status. This indicates whether the trace flag is ON (1) or OFF (0). The column heading for the trace flag number is either Global Trace Flag or Session Trace Flag, depending on whether you are checking the status for a global or a session trace flag.
The following example displays the status of all trace flags that are currently enabled globally.
DBCC TRACESTATUS(-1); GO
The following example displays the status of trace flags 2528 and 3205.
DBCC TRACESTATUS (2528, 3205); GO
The following example displays whether trace flag 3205 is enabled globally.
DBCC TRACESTATUS (3205, -1); GO
The following example lists all the trace flags that are enabled for the current session.
DBCC TRACESTATUS(); GO