Posted By:Karthikeyan AnbarasanPosted Date:February 27, 2011Points:100
Category: DataBaseURL:http://www.dotnetspark.comIn this article we are going to see on how to use a For Loop container task in SSIS packaging. For loop task is the looping implementation of a task by which the task will evaluate an expression and loops through the process and until the evaluation goes to False.

Introduction

In this article we are going to see on how to use a For Loop container task in SSIS packaging. For loop task is the looping implementation of a task by which the task will evaluate an expression and loops through the process and until the evaluation goes to False. We will see through the steps on using this container and how to configure the properties associated with this task.

To follow my series of articles on SSIS packages refer to the below URL's

Steps

Follow steps 1 to 3 on my first article to open the BIDS project and select the right project to work on integration services project. Once the project is created, we will see on how to use For Loop Container task options available with SSIS.

Once you created a project, just drag and drop the For Loop Container as shown in the below screen

Here I have placed an Execute SQL task to insert some records to a table. We are going to make use of the Loop container and insert to the table when it loops through. See the below screen once we have inserted the Execute SQL task inside the for loop container

Now we need to configure the For Loop Container, before proceeding we are going to set 2 variables which we are going to use in the loop process. To create a variable for to View ÃƒÂ Other windows ÃƒÂ Variable and assign values as shown in the below screen

Once we created the variable then go to the for loop container and double click it, it will open the container configuration as shown below. Just do the configuration as shown below

Here we have given the count as 10 so it will loop through the process 10 times and insert the same record 10 times into the table. Here I have created a table like this and inserted a single record as shown in the below screen. Once we execute the package we can see the data which is inserted.

Once the package is executed it will show as below

To check if the Package is executed properly or not go to the query analyzer and we can see the result as below

So we are good with the package execution process.

Conclusion

So this article explains clearly on the process of using For Loop Container and execute a particular task to loop through the process and use it for business.