i have a ssis project, to start with, i have a Foreach File Enumerator and inside it are multiple tasks. It works flawlessly under normal circumstances, however if there is no file present in the enumerator directory, an error occurs, the question is, how can i make a validation or some sort for it to avoid it throwing an error on runtime? thanks
img links
ssis
http://s15.postimage.org/l41py15aj/ssis.png
error
http://s15.postimage.org/rj0qupc0b/ssiserror.png
You can have a script task before
Foreachloop which basically checks for files and directory .Then have a precedence constraint to halt the package if either directory or files is not present .Create 3 variables
In the script task just check if the directory is present along with the files .You can modify the code if you need to even enumerate the subfolders or check if specific files are present in the folder
In the precedence constraint check the value for the variable
ExistsUpdate :
In the script task editor you need to add the variables in the
ReadOnlyVariablesection in the script tag