question

shamim007 avatar image
shamim007 asked

DBCC CHECKDB

Hi experts currently i need to create a agent job step with two parameters .DBCC CHECKDB with ALL_ERRORMSGS and NO_INFOMSGS . i am not sure how the query looks like . please help thanks
sql server 2008 r2dbcc
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
anthony.green avatar image
anthony.green answered
To pass in all error and no info you will need to do DBCC CHECKDB WITH ALL_ERRORMSGS, NO_INFOMSGS If you want to do this on every DB on the instance, you may be best looking at Ola Hallengren's maintenance routines which cycle through each DB and run the DBCC CHECKDB commands. Alternatively you could look at sp_msforeachdb, but that is an undocumented feature and functionality of it may change, or write your own loop to cycle through each DB
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.