I setup a package and want it to email me if there is any errors. Right now I got it working to send me a pre-written message about the failure, but I want to load the full task failure message into variable and email it on the email body.
But so far I have not found a way to save the error messages into variables so I can email them. Anyone can help with that one?
As far as I know there is no one system variable that stores the error message. So, you may not be able to use expressions with variables.
Also, keep in mind that you could get multiple errors per package. So, a single variable won't do the job.
An error report is what you basically need.
Assuming you are setting the "OnError" event handler, the error message, container name, etc. are logged in the sysdtslog90 table. You can query the table using the execution guid, which is available as a system variable to the package.
You can then dump the result set into an excel or a text file and email it as an attachment.
|||How did you set up even a pre-written mail message for errors?
Right now, I have an error log and a success mail message if everything else completes, but an error mail would be awesome.
|||sorry. i figured it out. i am new to ssis (3 months) and just noticed the event handler tab. please try to control your laughter.
|||Under email task editor- build an Expression for "Message source"
you could then do something like:
" There was a critical error in the Your Load. Error Msg follows " + @.[System::ErrorDescription]
to bubble up the error message.
No comments:
Post a Comment