job failure notification,if a step fails in between

  • hi,

    i have a job with 10 steps.

    i want to have a job failure notifcation, if any of the step fails.

    the steps are set up to run one after another with out dependences.

    all the steps run twice daily.

    can we have in tsql code, instead of on the job properties window.

    EX :job1:

    step1: call the ftp

    step2:load the file

    step3:run the update

    step4:setup the files for letter

    so, if step2 fails ,but the whole job is a success with a warning ,

    then how do we code for that notification to be sent..

    Thanks

    s

  • Easiest way is to fail the job if any step fails. Then setup your database mail and add operators. Setup the job to notify your operator if the job fails.

    You can also mail directly in T-SQL, say as part of a TRY-EXCEPT block.

    You can also do it in SSIS.

    Converting oxygen into carbon dioxide, since 1955.
  • hi,

    The business rule is to run all the steps,so i canot stop the job.

    this is for monitoring purpose for us to know which steps failed and react.

  • dsandhyarao (3/26/2010)


    hi,

    The business rule is to run all the steps,so i canot stop the job.

    this is for monitoring purpose for us to know which steps failed and react.

    I don't think that is possible in GUI, may be you can write custom script for job steps process.

    EnjoY!
  • Not sure I understand this one. If the steps have no dependencies, and you want to run every step regardless of the success or failure of a prior step...why not just create separate jobs?

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

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