Using the On failure in workflow

  • When using the on failure option is it possible to not fail the whole job when using this option??

    Steve Johnson


    Steve Johnson

  • I presented this question to 2 SQL instructors recently and both asked me "Why would you want to?" Many times we run a stored proc or activeX script and want the DTS to branch in either one of two (or more) ways depending on the results. Since succeed/fail/completion are the only options, you have to use the fail in some cases. But this makes the package look as if it fails. This is a problem if you have a legitimate failure in the package; you will never know if you have a real failure or not.

    I guess from a purists point of view, it is dangerous to override the failure - how would you ever know about a real failure? But on the other side, how do you handle conditional branching?

  • We have many DTS packages that used to have known failures in them. Some of them still have on failure sections because we still want certain tasks to be executed even though a few have failed and in the alternate route we get an e-mail that indicates the specific failure.

    We have since switched to marking tasks as completed to control the flow, however these still cause the job to complete claiming failure so for those we change it to claim success and have tasks within the package or that run after the package has run that check key points or changes to verify that there was no failure in what we expect to succeed.

    You can add a second step to the job that executes the DTS package and have the queries inside that step verify which tasks were completed successfully in the DTS package by checking data changes or whatever else your DTS package does.

    Robert Marda

    SQL Server will deliver its data any way you want it

    when you give your SQL Programmer enough developing time.

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

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

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