DBCC TRACESTATUS in Microsoft SQL Server

TRACESTATUS Displays the status of trace flags.

Syntax

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

Arguments
trace#: Is the number of the trace flag whose status will be displayed.
n: Is a placeholder that indicates multiple trace flags can be specified.

Result Sets
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#.

Remarks
To enable certain trace flags, use DBCC TRACEON. To disable trace flags, use DBCC TRACEOFF.

Permissions
DBCC TRACESTATUS permissions default to any user.

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 2528 and 3205.

DBCC TRACESTATUS (2528, 3205)
GO

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s