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)
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.