For Each loop doesn't break in package
Thanks Sudeep..
But How to post screen shot here.. and I have 2 for each loop and I am using only one for each loop.
Here is my package look like..
Execute SQL task---> For Each Loop
--->Execute SQL Task
----> Execute SQL Task
----> Execute SQL task
----->Data Flow Task
--->
Oledb source
-----> derived column
-----> Oledb Destiantion
Hope you will get it..if not then i will try to tell you more about it..
Thanks for your help..
Masti
January 13th, 2011 12:56pm
Here is the scenario..I have execute sql task which executes store procedure and generate the output recordset which is stored in to object varaible which contains around 5389 rows.After that I have for each loop to map those ado recordset with variable
mapping and inside for each loop I have three execute sql task and one data flow task..All togather whatever the output generated from the sp,I am passing those as input parameter inside for each loop and store output of execute sql task which is inside for
each loop in variables and then at the end in oledb destination...Everything is working fine...but When It returns all the row in the table after that loop does not break and goes into infinite loop and even when I try to stop debugger manually ,it does not
stop and at end I have to kill that application using task manager.
I really dont get the problem because when I just select 2000 rows then for loop breaks after return all 2000 rows but When it is more than 2000 rows it does not break..
Thanks 4 Your all help..
Masti
Free Windows Admin Tool Kit Click here and download it now
January 13th, 2011 2:03pm
What does it mean when you say u have 2 flor each loop and u are not using one of them?
And when u are saying the loop breaks do you mean the task completes when u are using 2000 rows? and when you use > 2000 rows the for each loop never ends?
Tweet me..
January 13th, 2011 2:08pm
Hi Masti,
Could you post a screen shot of your package. AS the description is not very clear. Do you have one for each loop or 2. Are you using any for loop as well?
Tweet me..
Free Windows Admin Tool Kit Click here and download it now
January 13th, 2011 2:26pm
No,I have only one for each loop..the type of enumerator is 2 means ForEachADO Recordset Enumerator.
And yes when I am using 2000 rows tak complete and for each loop breaks but when I am using more than that for each loop does not break...Suppose My sp returns 3000 rows...so here I am passing all 3000 rows one by one in for each loop..now at the oledb
destination once all 3000 rows return,the loop have to break ...right? ...but thats the problem although the it return all 3000 rows in the deatination,loop is keep going on for all tasks inside it and when I look at data flow task It says rows return but
actually in the destination table it does not return anything..so here I dont understand what for loop process after 3000 rows...
Thanks 4 your help..Masti
January 13th, 2011 2:32pm
So this is how my package look like..and one more thing i find that when I run the package and check in progress
tab,it shows starting of validation of around 2000 rows but in the table it already returns around 3000 rows...why this happen?? and when in the progress tab row validation reach upto the end of suppose 3000(which are the total no of rows)it stops debugging...which
is fine..But My problem is although all rows return already in the table , the package is keep executing untill all rows validate.
No,I have only one for each loop..the type of enumerator is 2 means ForEachADO Recordset Enumerator.
And yes when I am using 2000 rows tak complete and for each loop breaks but when I am using more than that for each loop does not break...Suppose My sp returns 3000 rows...so here I am passing all 3000 rows one by one in for each loop..now at the oledb
destination once all 3000 rows return,the loop have to break ...right? ...but thats the problem although the it return all 3000 rows in the deatination,loop is keep going on for all tasks inside it and when I look at data flow task It says rows return but
actually in the destination table it does not return anything..so here I dont understand what for loop process after 3000 rows...
Thanks 4 your help..
Masti
Free Windows Admin Tool Kit Click here and download it now
January 13th, 2011 6:37pm
See the stickies at the top of the forum for how to include a screenshot in a post.
Talk to me now on
January 13th, 2011 8:58pm
thanks todd...Masti
Free Windows Admin Tool Kit Click here and download it now
January 13th, 2011 10:36pm
Hi Masti,
In order to narrow down the issue, could you please help to remove all tasks inside the Foreach Loop task, and only use a simple Execute SQL Task inside the Foreach Loop task to inside value to a table, and then check if this works fine?
Thanks,
Jin ChenJin Chen - MSFT
January 18th, 2011 3:01am
Thanks Jin,
I tried tht and it was working perfectly fine but when i put data flow task again happened the same thing...Rows written in the table are more than what it showed in progress tab of package and when all rows written succesfully in the table the loop was
still going on...pleas help me on tht...
thanks 4 ur help..Masti
Free Windows Admin Tool Kit Click here and download it now
January 18th, 2011 5:25pm
Thanks For All help..
I got the solution ...I changed the "BYPass Prepare property" of each execute sql task to "true" and In the For each loop container ,on collection page select "Rows in All Tables(ADO.NET Dataset
only) ".NOw evrything is working fine..
Masti
January 21st, 2011 3:53am