Search code examples
ssisssis-2012ssis-2008

how to save error file names and error in text file using SSIS foreach file enumerator


In ssis I am using foreach file enumerator to pickup some data from each file. Sometimes the file have different format or some other file error because that file data is not get inserted.

I have @filename variable to store filename.

I want to save the file names and error message in text file only if file throws some error.


Solution

  • You can populate the @filename variable with a script before trying to get the data, and then in the OnError handler of the foreach loop, you read the variable to include the file name and error message in your text file.