Syntax for DBCC CHECKTABLE on all indexes?
- by GuinnessFan
Just want to check the syntax to make sure this is for one table and all indexes (default?).
--must be single user
ALTER DATABASE database_name SET SINGLE_USER;
DBCC CHECKTABLE
( "table_name"
, REPAIR_ALLOW_DATA_LOSS
)
WITH ALL_ERRORMSGS;
-- TURN BACK MULTI USER
ALTER DATABASE database_name SET MULTI_USER;
Also, should I be in the database containing the table to repair or should I be in master?