From the course: SQL Server Integration Services

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Group tasks in looping containers

Group tasks in looping containers - SQL Server Tutorial

From the course: SQL Server Integration Services

Start my 1-month free trial

Group tasks in looping containers

- [Instructor] If you need your package to execute a task or a series of tasks repeatedly, then you're going to want to look at the two looping containers that are available to be added to your control flow. The for loop container uses an expression to determine whether to repeat the tasks in the loop container again. As long as the expression evaluates to true the tasks will be executed again. When the expression returns false, then the for loop exits. The for each loop container will process the same tasks for every item in a group or what's referred to as an enumerator. For instance, you can use the file enumerator to run tasks against every file in a folder on your hard drive, or use the ADO enumerator to process each row in a table. To see a loop container in action, I'm going to add a for loop to a new control flow diagram in an empty package. The typical construct of a for loop in programming is to use a variable called a counter, to keep track of how many times a loop is…

Contents