2

I have an SSIS package with several data flow tasks. Each one imports a flat file into a table in my DB. I have created a connection manager for each underlying flat file. The package works just fine if all of the files exist. However, even if one of the files is missing, the entire package fails. I don't want this behavior. For whatever files that exist, I want my package to import them. For those that don't exist, I want SSIS to simply ignore them. At least one of the files will always exist. How do I achieve this behavior? I have seen some solutions that involve either scripts or file control tasks, but I'm not sure which is appropriate for my situation.

skyline01
  • 1,919
  • 8
  • 34
  • 55
  • You can do it like this: http://stackoverflow.com/questions/17568554/ssis-script-task-to-check-if-file-exists-in-folder-or-not – Greg the Incredulous Dec 16 '14 at 02:59
  • It fails. The error is? – Nick.Mc Dec 16 '14 at 04:14
  • So, I now have a script task before my data flow task. If the file exists, it goes to the data flow task. However, I don't know what to do if the file doesn't exist. I don't want the package to fail if the file doesn't exist. Any suggestions? – skyline01 Dec 16 '14 at 14:50
  • 1
    I used the method from here: http://www.bidn.com/blogs/DevinKnight/ssis/76/does-file-exist-check-in-ssis – skyline01 Dec 16 '14 at 14:59
  • Just to warn you the link in skyline01's reply seems to have been hijacked and looks malicious. Don't click it. – Mr McGoo Dec 13 '22 at 16:13

1 Answers1

0

my solution is 1. make a Script Task for checking the path file: SSIS Script task to check if file exists in folder or not 2. ValidateExternalMetadata set to False in the source properties 3. link the Script Task with next step if skip and create a Constrain and Variables connection with if the file exist

KeepLearning
  • 517
  • 7
  • 10