In my company’s SQL Server (2005), there’s a job that has about 20 steps. Each step is set to go to the next step on error. What’s the best method for getting a notification sent out if a step has an error?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The way I have done this is in between each step, have a step that sends a notification. So step 1 says on failure, move to “Step 2: notify that step 1 failed” and on success, move to step 3. Step 3 says on failure, move to “Step 4: notify that step 3 failed” and on success, move to step 5. Etc. Feels kind of dirty but since we were using simple database mail for alerts (rather than agent operators etc) it was very easy to code those intermediate steps. You can even use tokens so that all the steps simply call a stored procedure and the parameters can be filled in automatically.