locked
error handler for on error not executing when error occurs in task RRS feed

  • Question

  • Hi,

    I am runnnin SQL Server 2005 and SSIS.

    I have created a "Send Mail Task" for my on error error handler which is for a execute SQL task.
    * have purposefully made a sql task that will error.
    * have break pointed every possible event in the send mail task error handler but it never executes even when the task executes.
    * There is send mail task as the last step in my package execution and it runs fine.

    the message I get for the error in the progress tab is:
    Error: String or binary data would be truncated.
    [Execute SQL Task] Error: Executing the query " --load accountcode table insert into DIM_AccountCode select groupname, substring(groupname,1,4) + '-' + substring(groupname,5,4) + '-' + substring(groupname,9,4) + '-' + substring(groupname,13,4), groupdscrptn, substring(groupname,1,4), substring(groupname,5,4), substring(groupname,9,4), substring(groupname,13,4), NULL, NULL, NULL, NULL from usrgroup where classid = 6 and groupname <> '(any)'    " failed with the following error: "The statement has been terminated.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    Can somene please advise on how to configure my error handler "on error" to execute the Send Mail task.

    P.S: I've followed numerous tutorials on how to set it up but no luck yet.


    Thanks

    Chris

    Tuesday, April 6, 2010 2:10 PM

Answers

  • * There is send mail task as the last step in my package execution and it runs fine.

    Hi,

    How is it that the last send mail task is working it means that your package execution continues even after the error in the Execute SQL task.

    Does your execute SQL task turn red on execution? how are you executing the package? Are you executing the whole package or just executiong the Execute SQL Task.

    If you are just executing the EST the onError does not get triggered, you need to execute the package.


    Sudeep's Domain
    • Marked as answer by Haggisns Tuesday, April 6, 2010 2:44 PM
    Tuesday, April 6, 2010 2:33 PM

All replies

  • * There is send mail task as the last step in my package execution and it runs fine.

    Hi,

    How is it that the last send mail task is working it means that your package execution continues even after the error in the Execute SQL task.

    Does your execute SQL task turn red on execution? how are you executing the package? Are you executing the whole package or just executiong the Execute SQL Task.

    If you are just executing the EST the onError does not get triggered, you need to execute the package.


    Sudeep's Domain
    • Marked as answer by Haggisns Tuesday, April 6, 2010 2:44 PM
    Tuesday, April 6, 2010 2:33 PM
  • check this link and compaire with your code, see what 's missing

    http://plexussql.blogspot.com/2010/01/emailing-error-log-file-as-attachments.html


    Sincerely SH -- Please kindly don’t forget to mark the post(s) that answered your question and/or vote for the post(s)
    Tuesday, April 6, 2010 2:44 PM
  • Thanks so much Sudeep!

    you wrote: "If you are just executing the EST the onError does not get triggered, you need to execute the package." I did not no this "fairly" :) important piece of information !

     

    Chris

    Tuesday, April 6, 2010 2:45 PM