Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SSIS and Import/Export (2012)
 Resuable error handling pattern

Author  Topic 

LearningSQLKid
Yak Posting Veteran

51 Posts

Posted - 2014-11-13 : 05:42:19
Hi Guys

I am working on an SSIS project where i am using data flows. In data flow there can be read and write error. I have around 100 data flows divided into different packages. I want to write a reusable error handling routine which i should be able to call and if i need to make any change it should only be one place.... any idea ????


Thanks in advance

Select Knowledge from LearningProcess

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-11-13 : 08:48:50
how about this:

define a package to handle the errors. Define parameters for the error number, package name, time of error, etc. Make this package do what you want (log the error, email someone, etc.)

Then, in the main packages, set up error handling events that call this package, passing the values for these parameters.
Go to Top of Page

LearningSQLKid
Yak Posting Veteran

51 Posts

Posted - 2014-11-17 : 05:24:59
Thanks gbritton
But how i can make this to work with dataflow. For example if i have dataflow whic processes 10 row and 2 rows got error in read and 3 got error in write. i want to capture error row ... how would i do this ?

Select Knowledge from LearningProcess
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-11-17 : 08:57:16
in the dataflow, direct errors to a RowCount transformation. Set up a variable to capture the count. Then, in your error handling logic, you have the variable available to show how many failed. Same thing with rows that succeed.
Go to Top of Page
   

- Advertisement -