Can anyone tell me how to identify the specific column name that is causing an error when attempting to insert a data flow into an OLEDB Destination component? I am attempting to create a lot which specifies the error that occurred and the field name that caused the error. I am able to get the column ID, but I don't know how to translate this into a meaningful column name. Example: I get an "error field" value of 6581. I don't know which field is represented by 6581, so I don't know what column is causing the problem. I checked the sys.columns and sys.all_columns views to see if the column_id referenced by SSIS was perhaps one of those values, but I could not find anything useful there.
Below is a sample of code that is our best attempt at the moment to figure this out, but it seems really ugly. I'm using a script task and hard-coding to convert the error column id into an error column name.
I'm sure there is a better way to do this with no hard-coding.
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
' Add your code here
Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorCode)
If Row.ErrorColumn = 6581 Then
Row.ErrorColumnName = "SUBMISSION_ID"
Row.ErrorColumnName = Row.ErrorColumn.ToString()