Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I would like to setup alerts from within the maintenance plans. When you setup a notification from the Agent Job it sends out the Job name, duration, status, message.

If I add a Notify Operator Task it want's a subject and body. Will it still include the above information?

If not how can I have this information included?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Since the Maintenance Plan uses EXECUTE msdb.dbo.sp_notify_operator @name=N'some operator',@subject=N'some subject',@body=N'some body' there is no way to automatically include details about the Job Name, duration, status, etc. You could add a "on failure" precedence constraint that only executes the Notify Operator Task when a step in the maintenance plan fails. You could hard-code the Notify Operator Task with a specific message indicating the piece of the maintenance plan that failed. This will get pretty odious very fast, and still doesn't allow automating the error message you receive via email. This looks like:

enter image description here

Having said that, instead of using the built-in Maintenance Plans feature, you may want to look into Ola Hallengren's scripts that are built for this purpose, and offer a far wider range of options. You could then use standard Agent notification for the maintenance plan the way you do for other jobs.

http://ola.hallengren.com/

share|improve this answer

Your Answer

 
discard

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.