Floating FB popout byF5debug

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

 

This is part 12 of the series of article on SSIS

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.

You can look into my series of article on SSIS at the url - http://f5debug.net/tutorial/ssis.aspx

[more]

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

clip_image001

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

clip_image002

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

clip_image003

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

clip_image004

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.

clip_image005

Once the package is executed it will show as below

clip_image006

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

clip_image007

So we are good with the package execution process.

About Author: Karthikeyan Anbarasan, Microsoft MVP (Most Valuable Professional) in ASP.NET/IIS Architecture. He is the Founder and Chief Editor of the www.f5debug.net website and has authored books on Windows Phone and Business Intelligence(SSIS). He is also a Passionate Speaker and a Blogger on Microsoft Technologies.

You can Join Me On: Facebook, Twitter, Google Plus, LinkedIn

Comments (3) -

sreenath
sreenath
10/3/2012 9:46:47 AM #

Hi,
   I Am Sreenath,very good material,
if possible keep FOR EACH LOOP Container material

Lakshmi
Lakshmi
2/26/2013 2:14:52 AM #

From Where APP2 and APP2 type values are comming,here we havent mentioned any statement any where saying insert into table values ('app2','app2 type')

HongNgoc
HongNgoc
8/23/2013 8:59:31 PM #

Thank you so much. Your posts very helpful for me. But I have small problem when I executed this package (same with your example parkage), package finished but no rows is inserted to tables. Please help me to solve it .
Thanks.
PS: To Karthikeyan Anbarasan :I'm sorry , I posted my comment at Part14,it is missed.

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Recent Posts

Random Posts

Most Viewed

URL Shortner

Create your own short urls!!!

Site Counter

free counters

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer. For accuracy and official reference refer to MSDN/ TechNet. I have documented my personal experience on this blog.

Protected by Copyscape Web Plagiarism Finder

Site Meter