I have a project to implement custom logging in our SSIS packages. I have a Data Flow task that moves data from several tables in one database to the corresponding tables in another database. If the move of Table A from database A to database B fails, then in the OnTaskFailed event I would like to log the name of the Data Flow component to a text file because that name contains the name of the table that failed. I have tried using System::SourceName
and System::TaskName
, but they just give me the name of the Control Flow Task (SourceName) and the name of the Script Task itself in the event handler (TaskName).
Is there a way to get the Data Flow Component name?
The only way to do this is to tie up the DFT GUID to a name in the database/recordset and then do a lookup after your task fails/succeeds. This is not elegant, but is the only way to do it. Word of caution, if your objects change on the package, you will have to recreate the association on the database side.