April 3, 2019 at 8:14 am
Hello,
I have a SSIS package that has a File System Task inside a Foreach Loop Container that's used to move files. The files are generated every 5 minutes, and the package is run by SQL job agent every 5 minutes but last night they got out of sync and the package failed, because there was no file to pick up, the error message I got was 'Could not find file [filename]'. Is there anything I can do so that if this happens again the package won't fail and the job will move on to the next step? I have got DelayValidation set to true if that makes a difference, and I'm using SQL Server 2014 and Visual Studio 2015.
April 3, 2019 at 8:44 am
You can add a script task to check if file exists - searching this on internet will give a number of options
April 3, 2019 at 10:04 am
I Have Nine Lives You Have One Only
THINK!
April 3, 2019 at 12:37 pm
They way I usually like to solve this is to create an empty file (call it a template) for each source file. I copy the empty files to the processing folder and then overwrite them with the incoming source files.
This works well if you have multiple source files and want to continue processing (or make that decision later in the process) even if a source file is missing.
April 4, 2019 at 2:58 pm
Hi, this works for me when I want to be selective with files.
Dave
April 5, 2019 at 8:08 am
Thanks for all your suggestions. I have gone with adding an event handler to the System File Task container and setting propagate errors to false.
April 5, 2019 at 8:15 am
Hi, just be careful that you aren’t missing different errors on files that are actually present. Do you have some sort of audit table/ process that logs the outcome of each file?
Dave
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply