Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DBCC CHECKDB to check errors in SQL Server database

Is it possible to run: DBCC CHECKDB on a specific table in SQL Server 2005 database?

I have the following syntax:

DBCC CHECKDB 
[
    [ ( database_name | database_id | 0
        [ , NOINDEX 
        | , { REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD } ]
    ) ]
    [ WITH 
        {
            [ ALL_ERRORMSGS ]
            [ , EXTENDED_LOGICAL_CHECKS ] 
            [ , NO_INFOMSGS ]
            [ , TABLOCK ]
            [ , ESTIMATEONLY ]
            [ , { PHYSICAL_ONLY | DATA_PURITY } ]
        }
    ]
]

But keep getting incorrect syntax. I just want to run it to see what errors it throws up? Can you help me with writing the syntax? I want to remove all repair options.

like image 559
PriceCheaperton Avatar asked Jul 18 '13 11:07

PriceCheaperton


1 Answers

DBCC CHECKDB as it names apply is for checking databases.

There is a DBCC CHECKTABLE command for checking specific tables. Usage is:

DBCC CHECKTABLE ('YourTable');
like image 142
Nenad Zivkovic Avatar answered Oct 14 '22 16:10

Nenad Zivkovic