Page 200 - DCAP508_DATABASE_ADMINISTRATION
P. 200
Database Administration
Notes Control Flow
Handles the main workflow of the package and determines processing sequence within the
package. It consists of containers, different kinds of work flow tasks and precedence constraints.
Control Flow Tasks
A task is an individual unit of work. SSIS provides several inbuilt control flow tasks which
perform a variety of workflow actions. They provide functionality to the package in much the
same way that a method does in programming language. All the inbuilt tasks are operational
task except Data Flow Task. Though there are several dozen inbuilt tasks for use, if required they
can be extended and custom tasks can be written using VB/C# etc.
Containers
Containers group a variety of package components (including other containers), affect their
scope, sequence of execution and mutual interaction. They are used to create logical groups of
tasks. There are four types of containers in SSIS listed below:
Task Host Containers – Default container, every task falls into it.
Sequence Containers – Defines a subset of the overall package control flow.
For Loop Containers – Defines a repeating control flow in a package.
For Each Loop Containers – Loops for collection, enumerates through a collection for
example it will be used when each record of a record-set needs to be processed.
Precedence Constraints
Precedence constraints link the items in a package into a logical flow and specify the conditions
upon which the items are executed. It provides an ordinal relationship between various items in
the package; which helps manage the order the tasks will execute. It directs the order of task
execution and defines links among containers and tasks; evaluates conditions that determine the
sequence in which they are processed. More specifically, they provide transition from one task
or container to another.
The condition can either be Constraint or Expression or both. The constraint can be Success
(Green Line), Failure (Red Line) and Complete (Blue Line). The package in the image below
shows Script Task 1 will be executed only if the Execute SQL Task completed successfully; Script
Task 2 will be executed irrespective of whether the Execute SQL Task completed successfully or
failed; Script Task 3 will be executed only if the Execute SQL Task failed.
Figure 14.3
194 LOVELY PROFESSIONAL UNIVERSITY