SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


OLE DB Error Redirect - Generic Error Descriptions


OLE DB Error Redirect - Generic Error Descriptions

Author
Message
Dohsan
Dohsan
Mr or Mrs. 500
Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)

Group: General Forum Members
Points: 583 Visits: 3439
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.
Raunak Jhawar
Raunak Jhawar
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1641 Visits: 1944
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
Raunak Jhawar
Raunak Jhawar
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1641 Visits: 1944
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
Dohsan
Dohsan
Mr or Mrs. 500
Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)

Group: General Forum Members
Points: 583 Visits: 3439


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
Raunak Jhawar
Raunak Jhawar
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1641 Visits: 1944
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search