event handler, send mail on success and on failure

  • can anyone help me on how to use the event handler for sending an email on package success and on package failure??/

    it's urgent/!!!

    and tks for any help!!!

  • You can do it by enclosing all your control flow tasks into the "sequence container" then connect a send mail task to the sequence container. You can configure to fire the send mail task on either a success, failure or completion event by changing the property of the pipeline that connects the sequence container to the send mail task.

  • I just wanted to add that you do not need to put all control flow tasks from your package into a Sequence Container in order to use the Event Handling feature. You can choose to refer to the entire package when firing an event. After clicking the tab for "Event Handlers", just choose the package name for the "Executable" dropdown and then choose the event handler you wish to handle. Note that there is no built in On Success Event Handler so you would probably need to use the OnPostExecute event handler. In order to make this work, be sure to to set the property MaximumErrorCount to 1 so that the package execution stops after the OnError Event handler. Otherwise, OnPostExecute will run every time and you will not know when the package has executed successfully. A good tutorial for this is here:

    http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1304550_mem1,00.html

    Alternatively you can add 2 Email Tasks to your package: one for success emails and the other for failure emails. You can then set up a simple contraint so that a success email is sent only on success while an error email is only sent on failure.

    Bob Pinella

Viewing 3 posts - 1 through 2 (of 2 total)

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