Calling DBCC CheckDB from job

  • Hi All,

    If I call DBCC CheckDB from a JOB and the integrity check fails (for what ever reason) does the error bubble up and cause the job to fail?

    Cheers,

    [font="Times New Roman"]There's no kill switch on awesome![/font]
  • Nope. You could tweak my consistency check procedure[/url] to fit your needs.

    -- Gianluca Sartori

  • Gianluca Sartori (4/10/2012)


    Nope. You could tweak my consistency check procedure[/url] to fit your needs.

    Thanks for the reply - nice post too.

    However, i've done some searching around and have found a nice msdn blog which suggests that an agent job will fail http://blogs.msdn.com/b/cindygross/archive/2010/06/13/dbcc-checkdb-database-integrity.aspx

    i'll do some testing by creating a test database, corrupting a page and running the checkdb command to see what happens http://www.littlekendra.com/2011/01/24/corrupthexeditor/

    [font="Times New Roman"]There's no kill switch on awesome![/font]
  • I can confirm that if DBCC CheckDB errors during an agent job then the agent will throw an error 🙂

    I followed the post above to corrupt a database and my job threw the error.

    This is what my job ran: EXEC sp_MSforeachdb "USE [?]; DBCC CHECKDB WITH PHYSICAL_ONLY";

    [font="Times New Roman"]There's no kill switch on awesome![/font]
  • Totally misread your question, sorry.

    I thought you wanted to avoid the job failure...

    -- Gianluca Sartori

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

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