.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> DataBase >> Post New Resource Bookmark and Share   

 Subscribe to Articles

For Loop task in SSIS Packages - SQL Server Integration Services (SSIS) - Part 12

Posted By:Karthikeyan Anbarasan       Posted Date: February 27, 2011    Points: 100    Category: DataBase    URL: http://www.dotnetspark.com  

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.
 

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

Basics of SSIS and Creating Package - SQL Server Integration Services (SSIS) - Part 1

Transforming SQL Data to Excel Sheet - SQL Server Integration Services (SSIS) - Part 2

Export Data using Wizard - SQL Server Integration Services (SSIS) - Part 3

Import Data using Wizard - SQL Server Integration Services (SSIS) - Part 4

Building and Executing a Package - SQL Server Integration Services (SSIS) - Part 5

Options to execute a package in SSIS - SQL Server Integration Services (SSIS) - Part 6 

Options to Deploy a package in SSIS - SQL Server Integration Services (SSIS) - Part 7

Scripting in SSIS Packages - SQL Server Integration Services (SSIS) - Part 8

Breakpoints in SSIS Packages - SQL Server Integration Services (SSIS) - Part 9

Check Points in SSIS Packages - SQL Server Integration Services (SSIS) - Part 10

Send Mail in SSIS Packages - SQL Server Integration Services (SSIS) - Part 11

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.

 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend