Wednesday, November 23, 2011

For Loop Container in SSIS

I will use a very simple example to show the usage of For Loop Container in SSIS.

  • Create a new package level variable.


  • We will use this variable to loop through the for loop container. Below, I have initialized variable with value 1 and incremented it by 1 till it reaches 5.





  • Now, we can use this container to perform any task four times. For example, below I have added script task to for loop container and everytime value of variable is incremented MsgBox is popped out which displays the value of variable. 






  • Once that is done. Just run the package. And we can see MsgBox four times each time with value of variable.




That is it. It is a very simple example to demonstrate the use of for loop container. Although lot of useful stuff can be done with it. 






No comments:

Post a Comment