O'Reilly logo

Microsoft® SQL Server™ 2000 DBA Survival Guide, Second Edition by Mark Spenik, Orryn Sledge

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using DBCC and Trace Statements to Troubleshoot

DBCC stands for Database Consistency Checker. DBCC consists of a series of commands that perform a variety of functions on databases and database objects. DBCC commands are used to perform database and database object maintenance but also can be used to find errors—and in some cases, fix them. SQL Server also provides a series of trace flags that can be used to provide additional information about SQL Server such as the estimated and actual cost of a sort (trace flag 326). To turn a trace flag on for a single user connection, use the following syntax:

DBCC TRACEON(FLAG_NUMBER) 

For example, the following syntax would turn on trace flag 326:

DBCC TRACEON(326) 

To turn off a trace flag, use the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required