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
[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.

enter image description here

  • There's a few different problems in here. Which one are you trying to solve? Can you pop a picture of what your control flow looks like? SSC question – billinkc Feb 11 '16 at 14:54
  • Thanks for your response. I have edited my question to add a picture of the control flow. – jrdevdba Feb 11 '16 at 15:34
  • I think I may have found the problem. In my expressions for the precedence constraints, I had been using something like the following: @[User::ProcessFile] = False - but to check the value it seems this is needed: @[User::ProcessFile] == False. I figured it might be something basic like this that I just didn't realize due to inexperience with SSDT. – jrdevdba Feb 11 '16 at 16:42
  • As opposed to @[User::ProcessFile] == False – billinkc Feb 11 '16 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.