Skip to main content

SSIS_Containers (For loop,For Each Loop, Sequence Container)



-When we know the no of files present in the Source Folder then we use Forloop Container.
-When we dont know the now of files in the Source Folder we use ForEachLoop Container.

For Loop Container








Use the Below code in the Execute SQL Task.

Map the variable in the Execute SQL TASK.

The SQL Code for looping is 

Senario :
 Get the data from all the flat files(.TXT) and load all the data in the SQL server.

The Columns in the Flat files are same, only the Data Differs.



For Each Loop : 





If you want to dynamically loop through something you are supposed to add a variale for the file path.

For looping purpose , you are going to use DataFlow Task.


For the first file we should keep static connection.




Converting the Source into Dynmic 






We can Change the Datatype in a Derived column task by doing this.