Search code examples
ssisforeach-loop-container

Process flat file only if it does not has junk data in for each loop


I have a for each loop container which is processing flat files. A few of the files may have junk data. I want to ignore those files and process the other files without package failure.


Solution

  • What I have done in the past is to use a flatfile destination in the foreachloop container as an error output, so that any bad data in my sourcefile is sent there and the package does not fail.

    What you do is to insert the flatfile destination into the forechloop and connect it to flatfile source.

    After you have done this edit the Flatfile destination and point it to the error.txt and map the columns to error output columns. This is what works for me to get rid of bad data.