Control Flow Elements

A package consists of a control flow and, optionally, one or more data flows. SQL Server 2005 Integration Services (SSIS) provides three different types of control flow elements: containers that provide structures in packages, tasks that provide functionality, and precedence constraints that connect the executables, containers, and tasks into an ordered control flow.

The following diagram shows a control flow that has one container and six tasks. Five of the tasks are defined at the package level, and one task is defined at the container level. The task is inside a container.

Control flow with six tasks and a container

The Integration Services architecture supports the nesting of containers, and a control flow can include multiple levels of nested containers. For example, a package could contain a container such as a Foreach Loop container, which in turn could contain another Foreach Loop container and so on.

Event handlers also have control flows, which are built using the same kinds of control flow elements.

Containers

Containers provide structure in packages and services to tasks in the control flow. Integration Services includes the following container types, for grouping tasks and implementing repeating control flows:

  • The Foreach Loop container enumerates a collection and repeats its control flow for each member of the collection.
  • The For Loop container repeats its control flow until a specified expression evaluates to False.
  • The Sequence container lets you define a subset of the control flow within a container and to manage tasks and containers as a unit.

For more information, see Integration Services Containers

Tasks

Tasks do the work in packages. Integration Services includes tasks for performing a variety of functions.

  • The Data Flow task defines and runs data flows that extract data, apply transformations, and load data.
  • Data preparation tasks copy files and directories, download files and data, save data returned by Web methods, or work with XML documents.
  • Workflow tasks communicate with other processes to run packages or programs, send and receive messages between packages, send e-mail messages, read Windows Management Instrumentation (WMI) data, or watch for WMI events.
  • SQL Server tasks access, copy, insert, delete, or modify SQL Server objects and data.
  • Analysis Services tasks create, modify, delete, or process Analysis Services objects.
  • Scripting tasks extend package functionality through custom scripts.
  • Maintenance tasks perform administrative functions, such as backing up and shrinking SQL Server databases, rebuilding and reorganizing indexes, and running SQL Server Agent jobs.

For more information, see Integration Services Tasks.

Precedence Constraints

Precedence constraints connect containers and task in packages into an ordered control flow. You can control the sequence execution for tasks and containers, and specify conditions that determine whether tasks and containers run.

For more information, see Precedence Constraints

See Also

Tasks

Creating Package Event Handlers

Concepts

Creating Package Control Flow
Creating Package Data Flow

Help and Information

Getting SQL Server 2005 Assistance