Database Mail when Maintenance Plan Fails | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Database Mail when Maintenance Plan Fails

Hello I have the sql server 2005 maintenance plan set up and I get a mail at the end , that the maintance plan has succeeded . I want to receive the mail only when something goes wrong in the steps like, database backup fails , turncate log fails.How can I do that. Thanks
On the job schedule you can specify to mail out on failure too. Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing.
When I do that , even when the job fails , but the task is successful..so its not mailing the dba. I have plan like backup all database
maintenance clean up task
shrink database. So after each step I have the notify operator. But for example , the backup of a database fails , but the task i.e backup all database is executed successfully. so the dba doesnot receive the mail. what should I do Thanks
As Satya mentioned you should get failure notification becasue in MAINTENACE Plan if any of the task fails job fails… then you should get the email notification… unless you cofigured using COMPLETION expression in your plan… I think you have handle this in the maintenace plan too….
When the backup task fails send failure email notification using EXECUTE TSQL STATEMENT TASK and so on… Mohammed U.
Sorry guys I didnot get what you are explaining. I have a task , Backup of all databases followed by other tasks in the maintenance plan. If any one of the database backups fail , I should be receiving the mail. what is happening now , is the task backup of all databases is getting executed succuessfully , and the job i.e the backup of one database fails . I am not getting any mail. What should I do for this. Thanks

You can modify your maintenace plan package…
Add EXECUTE SQL task to send the email notification if the backup/indexing fails… Mohammed U.
If you’re not getting the notification, might try a test mail with databsae mail and check the profile name. Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing.
]]>