Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

OLE DB Error Redirect - Generic Error Descriptions Expand / Collapse
Author
Message
Posted Tuesday, November 05, 2013 6:28 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 9:18 AM
Points: 335, Visits: 2,358
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.
Post #1511461
Posted Thursday, November 07, 2013 12:10 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 4:39 AM
Points: 1,042, Visits: 1,829
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.


Regards/Raunak
Now a member of Linkedin

Please visit the all new Performance Point Forum
Please visit the all new Data Mining and Business Analytics Forum
Post #1512101
Posted Thursday, November 07, 2013 12:29 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 4:39 AM
Points: 1,042, Visits: 1,829
Also, you can design error handling like this:

http://vsteamsystemcentral.com/cs21/blogs/applied_business_intelligence/archive/2007/04/08/ssis-design-pattern-custom-error-handling.aspx


Regards/Raunak
Now a member of Linkedin

Please visit the all new Performance Point Forum
Please visit the all new Data Mining and Business Analytics Forum
Post #1512110
Posted Thursday, November 07, 2013 2:15 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 9:18 AM
Points: 335, Visits: 2,358


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
Post #1512150
Posted Thursday, November 07, 2013 2:17 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 4:39 AM
Points: 1,042, Visits: 1,829
Shout out loud if you need any further info!

Regards/Raunak
Now a member of Linkedin

Please visit the all new Performance Point Forum
Please visit the all new Data Mining and Business Analytics Forum
Post #1512152
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse