sql-serverssis

Can SSIS Precedence Constraints Rejoin Downstream


I've got an SSIS package that checks if a csv file is present in a folder, if so it needs to be imported and processed into a staging table, then the downstream steps can proceed. If not, just the downstream steps need to execute.

I'm using a ForEach container to check if the file exists and populating @FileExists as TRUE or FALSE. The precedence constraint and variable are working correctly, i.e. it returns TRUE or FALSE when appropriate. So far so good.

The problem I’m trying to solve is that the TRUE path stops when it gets to the downstream step where both TRUE and FALSE come together. My hunch is that the FALSE, which joins directly to the downstream step is preventing the TRUE from executing the downstream steps.

For now, I’ve duplicated the downstream steps and removed the place where TRUE and FALSE come together.

Is there a way to accomplish what I’m looking for without maintaining the same downstream steps twice?enter image description here


Solution

  • Assuming the original design had a branch on the "False" path that went directly to "Run SP", then you need to make the constraint an "OR". Check the constraint properties, by default it's set to "AND" and therefore requires both predecessor tasks to succeed. Changing it to "OR" means that only one predecessor job has to succeed (which is what you want) so either the TRUE path OR the FALSE needs to complete before "Run SP" will execute.