Thread: SQL Server 2005
View Single Post
  #32 (permalink)  
Old 11-06-2007, 01:27 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Dbcc Checktable

DBCC CHECKTABLE - Check the integrity of a table or indexed view.

Syntax
DBCC CHECKTABLE
('table' | 'view'
[ , { NOINDEX | index_id }
|, { REPAIR_ALLOW_DATA_LOSS | REPAIR_REBUILD }
]
)
[WITH
[ALL_ERRORMSGS
NO_INFOMSGS ]
[ , TABLOCK ] [ , ESTIMATEONLY ] [ , PHYSICAL_ONLY ]
]
Key:
NOINDEX - Skip intensive checks of nonclustered indexes.
REPAIR_ALLOW_DATA_LOSS - Try to repair all reported errors.
REPAIR_REBUILD - Perform all repairs that can be performed without risk of data loss.
REPAIR_FAST - deprecated option
ALL_ERRORMSGS - Return all reported errors per object, default = first 200 errors.
TABLOCK - Obtain locks instead of using an internal database snapshot.
ESTIMATEONLY - Display the estimated amount of tempdb space that would be required.
PHYSICAL_ONLY - Limits the checking to the integrity of the physical structure

To repair errors restore from a backup, use the REPAIR options only as a last resort.

Examples

-- Check the integrity of MyTable in 'MyDatabase'
USE MyDatabase;
GO
DBCC CHECKTABLE ('MySchema.MyTable')
GO
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Reply With Quote