How can I send emails with error details if there is any error in package execution? Basically how can I get error details and put them in Message of Send mail task?
+1
A:
This is what we do. We use the logging system of SSIS to log all errors to a table.
Then create an event handler at the package level. IN the event handler I send an email when something fails that contains the name of the package (which we always havea as a variable), the name of the task that failed (use variable System::SourceName for this, took me a while to find it.) and a query of the logging tables to enable the support team to quickly pull up the details (part of the body of the email, I use a variable but you don't have to).
HLGEM
2010-03-18 18:56:31
System::PackageName also holds the name of the package, so you don't need to create a variable to hold it. If you are using the default logging format, your log query will be "Select * from dbo.sysdtslog90 where executionID = " along with the value of System:ExecutionInstanceGuid. ** These variable and table names valid in Sql Server 2005 may be different in other versions**
William Todd Salzman
2010-03-18 21:10:19
We do because we have names in our our meta data database that may not exactly match the package name and I need to use that name. And our queries are differnt because we parse out the logging information into a more user friendly format in our meta database. But your point is exactly correct if you aren't using a customized meta database, William.
HLGEM
2010-03-18 22:26:06