views:

537

answers:

2

I want to make a general error handling package that should be called from my other packages when something goes wrong. In this error handling package I want to log what task failed and the reason for the failure. How can I retrieve this information?

I'm using the Control Flow Failure precedence constraint to point out a Execute Package Task that executes the error handling package when something goes wrong.

A: 

Take a look at the following article by Jamie Thomson that shows how to get the error description using a Script Task.

http://consultingblogs.emc.com/jamiethomson/archive/2005/08/08/1969.aspx

You can find an alternative approach to Error Handling in SSIS on an article from SQL Server Central

Error Handling in SSIS

John Sansom
Thanks for the answer, but that article uses a Script Component in the Data Flow and is irrelevant to my case where I'm in the Control Flow and using a Script Task.
Cros
+1  A: 

I've done it, the only thing I needed was the executionid and the logging in a sql server so I could run a query like this:

SELECT event, computer, operator, source, starttime, endtime, message FROM sysdtslog90 WHERE (executionid = '?') AND (event = N'OnError') ORDER BY starttime DESC