Detecting DBCC CHECKDB completion status

  • Is there a way to check whether any errors were reported by a DBCC CHECKDB short of looking at the output?

    If I have to look at the output does the existence of the line:

    "CHECKDB found 0 allocation errors and 0 consistency errors in database 'Test'."

    guarantee there were no errors reported?

    Thanks.

    Phil.

  • No replies yet!!

    Basically what I am asking is does DBCC CHECKDB return an @@ERROR value <> 0 if it reports errors, or is it necessary to scan the output text for errors.

  • Yes you can use @@error.

    Zero = no problems.

    Non zero = a problem (usually in the range 8900 - 8999).

    Jeremy

  • Thanks Jeremy

    Phil.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply