Tuesday, November 30, 2010

How to get ErrorDescription in SSIS

If you use an Error Output in SSIS you will get the ErrorColumn and ErrorCode and not the Error Description. You can get the ErrorDescription by using a script component.

Make sure you a column to the Output that is going to contain the Error Description and use the following code.

VB.NET
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorCode)
End Sub

C#

public override void Input0_ProcessInputRow(Input0Buffer Row)
{
Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorCode);
}

No comments:

Post a Comment