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


Recurring errors in Loop ( SSIS )


Recurring errors in Loop ( SSIS )

Author
Message
connect.akshay
connect.akshay
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
Points: 23 Visits: 181
I have an SSIS package where I am processing some files in a ForEach loop. In the loop I have a data flow task which does the processing. I have made sure that the loop doesn't stop even if there is bad file by setting the maxerror count of the loop to '0'. I tried to catch the error in a message box using the script task on 'ON ERROR' Event handler of the loop container. Instead of getting one error , I get three. 'Popagate' is set to false on the data flow’s OnPostExecute event. Please help.

Main package - Loop Task - Data Flow Task
Andrew G
Andrew G
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2485 Visits: 2254
What are the errors?
connect.akshay
connect.akshay
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
Points: 23 Visits: 181
it's just a custom error that i am populating using the script task on the 'ONERROR' handler of the Loop. The problem is, it is getting populated 3 times.

Attached is the screenshot of the package.
& the error that I am populating is "file XYZ couldn't be processed".
Attachments
SSIS.JPG (12 views, 35.00 KB)
Andrew G
Andrew G
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2485 Visits: 2254
That sounds correct if you have 3 files that are failing?

Instead of using the OnError event to run a script task, can you use the failed precendence constraint on the ForEach loop container to run the script task?
connect.akshay
connect.akshay
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
Points: 23 Visits: 181
3 errors are coming for 1 file.
I want to make sure that the loop goes on executing even if the processing of one of the files fails.
Also I want to send a mail for the corrupted file, which i am sending through the script task of the event handler.
This problem will also occur if i want to log the error messages. It will be logged thrice and not a consolidation of the same error of the same file.
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