Send Mail Task - Message

  • Hello Friends,

    I have a SSIS package having different tasks.

    At the end of all the tasks I have a Send Mail Task, which is set on Error.

    It means, if the package fails, then it should send an email to the mentioned email id.

    My question is that is there any way that I could include the exact error message in the text?

    I mean suppose the package has error in Step 2.

    So, there will be an error message: The package failed because .....................

    I wanted to know if this error message: The package failed because....................can be included in the body of the email that it will be sending.

    If there is any system variable that can do that, or if we can create any user variable.

    Please do let me know in detail, if you have any answer for this.

    Thank you.

  • Create a event handler at package level to capture the OnError Event.

    Even Hanlders - > OnError

    Add a SendMail task here. There are system variables: @[System::ErrorCode], @[System::ErrorDescription] that you can use to generate your email message. For this go to Expressions on the Send Mail task editor and set the expression for MessageSourse something like

    "Pakage failed to exedute. Error Description: " + @[System::ErrorDescription]

    HTH

    ~Mukti

  • Mukti,

    Thanks a lot for your reply. I like this way, but if there are 4 errors, then I am getting 4 error emails.

    Can you please help me find a way where I can get only one email for all the 4 errors.

    May be using a variable, but I am not sure how.....

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

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