I don't know why SSIS didn't put error descriptions automatically in the source error outputs. We just have the error code and error column. Thus we still need to place a Script Component to get the error description.
On the Script Transformation Editor, add an output column "Error Description" in the Inputs and Outputs tab. Then click the Design Script button from the Script tab and add the ff. code which gets the error description based on the error code:
Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorCode)
Take note to change the data type of the newly-created output column since the default data type is integer.
On the Script Transformation Editor, add an output column "Error Description" in the Inputs and Outputs tab. Then click the Design Script button from the Script tab and add the ff. code which gets the error description based on the error code:
Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorCode)
Take note to change the data type of the newly-created output column since the default data type is integer
I almost always overlook this and jump to the script code soon and get a mismatched data type exception afterwards. :)
Thanks to Jamie Thompson's article for this very useful info on getting the error descriptions in SSIS.
Thanks to Jamie Thompson's article for this very useful info on getting the error descriptions in SSIS.
1 comment:
Thanks from Lima, PerĂº.
Post a Comment