Full disclosure: I posted this on SQL Server Central yesterday but got no answers. I hope someone here can assist me.
I'm working on importing flat files into a database. I have used a Foreach loop in an SSIS project in SQL Server Data Tools for SQL 2012. have just started developing these packages so please let me know of any rookie mistakes I need to correct.
If even one of the files has not been updated in the last day, I want the processing to stop and an alert email sent out.
Schematically, the control flow I need is as follows:
[Foreach loop] ---> Failure ----> Send import failure email | | ↓ Success ↓ [Proceed with import]
I have tested with setting one of the files to be too old, on purpose, to trigger the failure. What happens now, though, is that I get the Failure email but I also get a SQL error from a task in the
Proceed with import section, as if the Success path has also been followed.
In both success and failure cases, I have tried to set Precedence Constraints with "Expression and Constraint" as the Evaluation operation, with a Boolen value set for the expressions.
@[User::ProcessFile]= False or
@[User::ProcessFile]= True depending on the case.
Could someone explain (or direct me to a reference explaining) how to make sure the SSIS package is following the path I expect it to?
EDIT: Picture of control flow is below.