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:

16 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

  3. Generally I do not learn post on blogs, however
    I would like to say that this write-up very pressured
    me to take a look at and do so! Your writing taste has been amazed me.
    Thank you, very nice post.

  4. Asking questions are really good thing if you are not understanding anything fully, but this
    article offers fastidious understanding yet.

  5. This design is spectacular! You obviously know how to keep a
    reader entertained. Between your wit and your videos,
    I was almost moved to start my own blog (well, almost…HaHa!) Wonderful job.
    I really loved what you had to say, and more than that, how you
    presented it. Too cool!

Leave a Reply

Your email address will not be published.