DBCC (T-SQL)

The Transact-SQL programming language provides DBCC statements that act as the “database consistency checker” for Microsoft® SQL Server™. These statements check the physical and logical consistency of a database. Many DBCC statements can fix detected problems.

These database consistency checking statements are grouped into these categories.

Statement category Perform
Maintenance statements Maintenance tasks on a database, index, or filegroup.
Miscellaneous statements Miscellaneous tasks such as enabling row-level locking or removing a dynamic-link library (DLL) from memory.
Status statements Status checks.
Validation statements Validation operations on a database, table, index, catalog, filegroup, system tables, or allocation of database pages.

SQL Server’s DBCC statements take input parameters and return values. All DBCC statement parameters can accept both Unicode and DBCS literals.

Maintenance Statements
DBCC DBREPAIR DBCC SHRINKFILE
DBCC DBREINDEX DBCC UPDATEUSAGE
DBCC SHRINKDATABASE  

Miscellaneous Statements
DBCC dllname (FREE) DBCC TRACEOFF
DBCC HELP DBCC TRACEON
DBCC PINTABLE DBCC UNPINTABLE
DBCC ROWLOCK  

Status Statements
DBCC INPUTBUFFER DBCC SHOW_STATISTICS
DBCC OPENTRAN DBCC SQLPERF
DBCC OUTPUTBUFFER DBCC TRACESTATUS
DBCC PROCCACHE DBCC USEROPTIONS
DBCC SHOWCONTIG  

Validation Statements
DBCC CHECKALLOC DBCC CHECKTABLE
DBCC CHECKCATALOG DBCC NEWALLOC
DBCC CHECKDB DBCC TEXTALL
DBCC CHECKFILEGROUP DBCC TEXTALLOC
DBCC CHECKIDENT  

  


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