OLE DB Error Redirect - Generic Error Descriptions

  • I have a very simple package I'm experimenting with error handling on, which takes a flat file (CSV) and then inserts it into a table in SQL Server.

    With the Flat File Source I've redirected the rows to a script component to get an error description and the data viewer shows the error descriptions are column specific to the deliberate 'duff' test data I've put in (Strings exceeding a certain length, text in integer columns etc.), which I'm happy with.

    However, when I do something similar with the redirected rows from my OLE DB Destination the error raised is very generic and the same for all rows that fail (The destination source data access mode has been set to "Table or View" so rows that pass validation do get inserted into the table)

    ErrorCode: -1071607683

    ErrorDesc: The data value violates integrity constraints.

    The test table has a PK, a FK and Check constraints and similar to the flat file error handling, I've deliberately added data which violates each of these to check that it will throw an error.

    Is it possible to get something more specific as an error description to say why that certain row has not been inserted? So if for example its a duplicate row that violates the PK, the description would say as much?

    My script component very simple and takes the redirected error code from the row and translates to a description:

    public override void Input0_ProcessInputRow(Input0Buffer Row)

    {

    Row.ErrorDescription = this.ComponentMetaData.GetErrorDescription(Row.ErrorCode);

    }

    Any suggestions or alternatives methods welcome.

  • Hi Doshan, have you checked this link

    If custom error message(s) is the ultimate requirement, in that case you will have to design a custom component with all sorts TRY...CATCH blocks to capture error events.

    Raunak J

  • Thanks Raunak, I've only had time to quickly flick through this, but I think this may go some way to achieving what I want. Will have to digest it fully when I have some more time.

    Ta

    Dohsan

  • Shout out loud if you need any further info!

    Raunak J

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply