1170
Part IX: Business Intelligence
Using Containers
Containers provide important features for an Integration Services package, including itera-
tion over a group of tasks and isolation for error and event handling.
The containers available are as follows:
■ (^) TaskHost: This container is not visible in a package but implicitly hosts any task
that is not otherwise enclosed in a container. Understanding this default container
helps you understand error and event handler behaviors.
■ (^) Sequence: This simply contains a number of tasks without any iteration features,
but it provides a shared event and error-handling context, provides task grouping
for control fl ow logic, and enables the entire container to be disabled at once dur-
ing debugging.
■ (^) For Loop: This container provides the ability to iterate over the contained tasks
until an evaluation property evaluates to false. It is the SSIS equivalent to pro-
gramming For Loops.
■ (^) Foreach Loop: This container provides iteration over the contents of the container
based on various lists, or enumerators of items:
■ (^) File: Each fi le in a wildcarded directory command.
■ (^) Item: Each item in a manually entered list.
■ (^) ADO: Each row in a variable containing an ADO recordset or ADO.NET data set.
■ (^) ADO.NET Schema Rowset: Each item in the schema rowset from an ADO connec-
tion manager.
■ (^) Foreach From Variable: Each item in a variable containing an array. The array
is populated programmatically, usually by a script task.
■ (^) Nodelist: Each node in an XML XPath result set.
■ (^) SMO: List of server objects (such as jobs, databases, fi le groups).
Choose the enumerator type to be iterated on the Collection page, and then map each item
being iterated over to a corresponding variable on the Variable Mapping page.
In addition to containers, the Integration Services Designer also creates task Groups.
Defi ne a group by selecting a number of Control Flow items, right-clicking one of the
selected items, and choosing Group. This encloses several tasks in a group box that can be
collapsed into a single title bar. This group has no properties and cannot participate in the
container hierarchy — in short, it is a handy visual device that has no effect on how the
package executes.
Using Control Flow Tasks
Tasks that can be included in control fl ow are as follows:
c52.indd 1170c52.indd 1170 7/31/2012 10:29:28 AM7/31/2012 10:29:28 AM
http://www.it-ebooks.info