Precedence Constraints: how to control the flow of task execution
Precedence Constraints are arrows in the Control Flow which define execution priority of tasks and other executables in the Control Flow. In the samples of this book till now we used simple Precedence Constraints a lot.
In this recipe, we will explore a new way of using Precedence Constraints and we will implement an if
condition in the Control Flow with Precedence Constraints.
Also, we will reveal options to work when there are multiple Precedence Constraints for each executable.
How to do it...
Create a SSIS project and name it as
R06_Precedence Constraints
.Create a
RecordCount
package variable of typeint32
. Set the default value to0
.Add an Execute SQL Task into the Control Flow, create an OLE DB Connection to the
AdventureWorks2008R2
database.Type the following query in the SQL Statement property:
SELECT COUNT(*) AS Cnt FROM Sales.Customer WHERE DATEDIFF(Day, ModifiedDate, GETDATE()) < 0
As the previous statement will return...