Errors produced by dbcc Procedures
If any dbcc procedure produces an error, it means that SQL Server did not store your data correctly, or that it has incorrectly assigned storage to tables. When they do generate an error, you should use the dbcc with the Fix options to correct the errors.
Expand Minimize
DBCC CHECKDB
SQL Server 2000
Checks the allocation and structural integrity of all the objects in the specified database.
Syntax
DBCC CHECKDB
( 'database_name'
[ , NOINDEX
| { REPAIR_ALLOW_DATA_LOSS
| REPAIR_FAST
| REPAIR_REBUILD
} ]
) [ WITH { [ ALL_ERRORMSGS ]
[ , [ NO_INFOMSGS ] ]
[ , [ TABLOCK ] ]
[ , [ ESTIMATEONLY ] ]
[ , [ PHYSICAL_ONLY ] ]
}
]
Arguments
'database_name'
Check all Object Allocation and Structural Integrity
Is the database for which to check all object allocation and structural integrity. If not specified, the default is the current database.
Database names must conform to the rules for identifiers. For more information, see Using Identifiers.
NOINDEX
Specifies that nonclustered indexes for nonsystem tables should not be checked.
NOINDEX decreases the overall execution time because it does not check nonclustered indexes for user-defined tables. NOINDEX has no effect on system tables, because DBCC CHECKDB always checks all system table indexes.
REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST| REPAIR_REBUILD
Specifies that DBCC CHECKDB repair the found errors. The given database_name must be in single-user mode to use a repair option and can be one of the following.