Run Foreach loop iteration in Parallel
Hi, I need to run the tasks in a Foreach loop in parallel. For each server name from a database table, I need to spawn off an EXE to run on that server. I want to be able to spawn off the process in parallel on all the servers without having to wait for the process to complete on one server before I can start on the next server. I did see some recommendation on using CozyRoc's Parallel Loop Task to achieve something like this. Reading through the documentation, it seems like it is only to execute package tasks. Im looking for executing Process tasks in parallel. I might be wrong here, because I could not open up their sample package. Here is the link : http://www.cozyroc.com/ssis/parallel-loop-task I do see some posts with the same exact question of being able to run tasks in Foreach loop in parallel. Some of the posts are dated back to 2005. With newer version of SSIS being released after that, Im hoping to get a different/positive answer that it can be done! Any answer/help on this will be Greatly appreciated! Thanks for your time!
December 10th, 2010 3:43pm

Hey, Its pretty cool that you asked about this task. I actually suggested it to CozyRoc and they developed it pretty quickly. I use it all over the place and it works great. I built something that does almost exactly what you are trying to do. It pulls a list of servers from a table and executes a command line app passing in the server name, all in parallel. Not sure exactly what issue you are running into, but if you want me to email you the package I developed I can. Let me know...thanks! Craig
Free Windows Admin Tool Kit Click here and download it now
December 11th, 2010 7:58pm

Hello Craig, Thank you for your response on this! I was wondering if with newer versions of SSIS, Microsoft had this out of the box. But. itseems like CozyRoc is the way to go for this. I did download the CozyRoc's SSIS library to try out the Parallel Loop Task. Im little confused on how the Control flow would look like with this Parallel Loop task and what the PackageConnection in its Properites meant. When I read the documentation, I imagined that this would replace the ForEach loop in the package. But, I guess Im wrong. Itseems like, I need to have a Foreach loop with all the tasks in it and the Parallel Loop Task should point to this ForEachLoop. Should ForEach loop be in a different package or in the same package but not part of control flow? Im confused. Looking at a sample would greatly help. Thanks for offering to email me the package, I really appreciate your help. Thank you!
December 13th, 2010 5:01pm

Hello Craig, Thank you for your response on this! I was wondering if with newer versions of SSIS, Microsoft had this out of the box. But. itseems like CozyRoc is the way to go for this. I did download the CozyRoc's SSIS library to try out the Parallel Loop Task. Im little confused on how the Control flow would look like with this Parallel Loop task and what the PackageConnection in its Properites meant. When I read the documentation, I imagined that this would replace the ForEach loop in the package. But, I guess Im wrong. Itseems like, I need to have a Foreach loop with all the tasks in it and the Parallel Loop Task should point to this ForEachLoop. Should ForEach loop be in a different package or in the same package but not part of control flow? Im confused. Looking at a sample would greatly help. Thanks for offering to email me the package, I really appreciate your help. Thank you!
Free Windows Admin Tool Kit Click here and download it now
December 13th, 2010 5:01pm

Hello Craig, I found a sample package that I could use to get the Parallel Loop task in tha package. Im unable to get it working. I have a SQL task which gets a list of all the server names. In the Foreach loop, I iterate through each server name and then perform some process tasks with the servername as parameter to the process tasks. With Parallel loop task, Im seeing that Foreach variable which gets the value of the iteration is blank or NULL. Could you please let me know what Im doing wrong. Thank you!
December 14th, 2010 12:47pm

I got it working. The Foreach variable must in the scope of the ForEach Loop task and not the package scope.
Free Windows Admin Tool Kit Click here and download it now
December 14th, 2010 2:25pm

Yep, I had the same problem ;) Craig
December 14th, 2010 4:56pm

If you still need the package I created send me your email address and I will forward it onCraig
Free Windows Admin Tool Kit Click here and download it now
December 14th, 2010 4:57pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics