ssis

How do I convert the ErrorCode and ErrorColumn in SSIS to the error message and column name?


I am redirecting rows from a flat file source to a flat file destination. The default metadata in the redirected rows are:

What I get in the output flat file is the source row (nice) and the error code (not nice, ex. -1071628249) and the error column (not nice since it's the internal ID of the column).

How can I transform the rows to output the error message (e.g. "The data was truncated.") and the column name as defined in the flat file source?

In other words, instead of ...,-1071607675,10 I'd like to see:

...,The data was truncated,Firstname

or alternatively (if the previous is not possible);

...,DTS_E_FLATFILESOURCEADAPTERSTATIC_TRUNCATED,Firstname.


Solution

  • Part of the question (adding the error description) can be achieved with a script component. This is described in Enhancing an Error Output with the Script Component.

    It seems that the Dougbert blog has a solution to adding the column name, but it's far from simple. I'm amazed this is so difficult to do in SSIS; you'd think it was a basic need to know the name of the source and column.