Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a maintenance plan on my SQL 2008 box - I would like it to send an email address when (or if) it fails. I've set up database mail, and can send a test email..

How can I do this?

share|improve this question
up vote 3 down vote accepted
  1. Configure SQL Server Agent to use database mail
  2. Create operator(s) mail, pager, hours, etc.
  3. Configure maintenance plan to email appropriate operator(s) based on exit condition.

share|improve this answer
I've done this... but i can't seem to do number 3...? Where do i find the exit conditions on my tasks? i only have a green arrow coming out of the event box on the designer... – alex Jan 16 '10 at 2:44
You don't. Edit the SQL Agent job and configure the job to send you an email on job failure. – mrdenny Jan 16 '10 at 11:08
If you want to be notified per task (when a task fails, rather than when a plan fails), double click on a green arrow to open its properties and change the Value to Failure. You can create multiple arrows ("precedence constraints"?) from a single task, so you can have one which performs the next task upon Completion, and another which sends an email on Failure. If the task fails, the condition for both arrows will be met and both the next task and the email task will be run. – Dave May 3 '13 at 20:58

Add an Execute SQL task to your maintenance plan that makes the call to sp_send_dbmail and connect the failure routes of any of your other tasks to this task.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.