Home » Setting up ForLoop to load CSV Files and Setting up Execute on error in SSIS

Setting up ForLoop to load CSV Files and Setting up Execute on error in SSIS

For loop can be used to setup a loop to selecting all CSV’s in particular location based on a pattern like C:App*.csv for all files starting with App in their name in C Drive root Folder.

This can be achieved by using following steps:

1. Create a Variable to store the connection string.

2. Drag a For loop in control and set the directory to look for and pattern. Map the variable as shown below.



3. Drag a DataFlow task and set the FlatFile connection connecting any of the files in that location.

4. Now change connection manager properties in Expressions to use the connection string using the variable created above.

5. Perform transformations and load into destination.

Now, say you have one file which does not match the same columns or invalid. So, you want the execution not to stop on error.

This can be achieved by using event Handler on DataFlow Task Forloop and making propagate on error to False as shown below:

11 thoughts on “Setting up ForLoop to load CSV Files and Setting up Execute on error in SSIS”

  1. I truly appreciate this post. I have been looking all over for this! Thank God I found it on Google. You have made my day! Thank you again. Fred Royce Amandie

  2. Having read this I thought it was extremely informative. I appreciate you finding the time and effort to put this information together. Jenn Chevalier Veedis

Leave a Reply

Your email address will not be published. Required fields are marked *