DBCC TRACESTATUS (T-SQL)

Displays the status of trace flags.

Syntax

DBCC TRACESTATUS (trace# [,...n])

Arguments
trace#
Is the number of the trace flag to display the status of.
n
Is a placeholder indicating that multiple trace flags can be specified.
Result Sets

DBCC TRACESTATUS returns this result set; trace flags 106 and 107 were specified (values may vary):

TraceFlag   Status     

----------- -----------

106         0

107         0

  

(2 row(s) affected)

  

DBCC execution completed. If DBCC printed error messages, contact your system administrator.

  

DBCC TRACESTATUS returns a column for the trace flag number and a column for the status, indicating whether the trace flag is on (1) or off (0). To get status information for all trace flags currently turned on, specify - 1 for trace#.

Permissions

DBCC TRACESTATUS permissions default to members of the sysadmin fixed server role only, and are not transferable.

Examples
A. Display the status of all trace flags currently enabled

This example displays the status of all currently enabled trace flags by specifying a value of -1.

DBCC TRACESTATUS(-1)

GO

  

B. Display the status of multiple trace flags

This example displays the status of trace flags 204 and 107.

DBCC TRACESTATUS (204,107)

GO

  

See Also
Trace Flags DBCC

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.