Home > Check Enabled Traces, DBCC > Check Enabled Traces

Check Enabled Traces

How to check how many Traces are enabled on the server  and how traces are set (globally or session)

In SQL Server, there are two types of trace flags: session and global. Session trace flags are active for a connection and are visible only for that connection. Global trace flags are set at the server level and are visible to every connection on the server.

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
Categories: Check Enabled Traces, DBCC
  1. No comments yet.
  1. No trackbacks yet.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: