Trace Flag Commands

The following commands are used to turn on and off trace flags as well as to check the status of a trace flag:

Syntax

DBCC TRACEOFF (trace# [,...N]) 

DBCC TRACEON (trace# [,...N])

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

TIP

The trace flag 1200 can be useful for tracking locking behavior. You must also turn on trace flag 3604 to echo trace information to the client workstation (see SQL Server's Books Online for a complete list of trace flags).

Example

use pubs 
go
DBCC traceon(3604)
DBCC traceon(1200)
UPDATE authors
SET au_lname = 'smith'
WHERE au_id = '172-32-1176'
go
/* turn trace flags off */
DBCC traceoff(3604)
DBCC traceoff(1200)
go

Sample Output from DBCC Trace Flag 1200

 DBCC execution completed. If DBCC printed error ...

Get Microsoft® SQL Server™ 2000 DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.