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

Bernhard Hofmann picture Bernhard Hofmann · Oct 2, 2012 · Viewed 57.7k times · Source

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

  • The original flat file source row
  • The ErrorCode
  • The ErrorColumn

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.

Answer

Perdi Estaquel picture Perdi Estaquel · Jan 13, 2014

Error message list is in the following location: MSDN, Integration Services Error and Message Reference https://docs.microsoft.com/en-us/sql/integration-services/integration-services-error-and-message-reference?view=sql-server-ver15

And column Id Number can be found in SSIS's Data Flow Task: select the task component that generates the error, Advanced Editor, 'Input and Output Properties' tab, External Columns Properties.