Checks the allocation and structural integrity of all the objects in the specified database in SQL Server
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
} ]
)
For each table in the database, DBCC CHECKDB checks that:
• Index and data pages are correctly linked.
• Indexes are in their proper sort order.
• Pointers are consistent.
• The data on each page is reasonable.
• Page offsets are reasonable.
Examples-- Check the current database.
DBCC CHECKDB
GO
-- Check the pubs database without non-clustered indexes.
DBCC CHECKDB ('pubs', NOINDEX)
GO