In my previous article on SSIS we spoke about Packages,Connections and Data Sources. In this article we will talk about Control Flow Objects and how we can use them.
So what is Control Flow?
Control Flow is the engine which manages the workflow of the tasks created coupled with the control flow containers and constraints. SSIS provides a Design UI which displays a workspace where we can configure different control flow objects.
SSIS provides three types of control flow objects
1) Tasks – Tasks are objects that perform specific work
2) Containers – Containers help group different tasks
3) Constraints – Constraints help connecting different tasks and containers. Its also helps to define the order of execution of different tasks.
A package must contain at least one task that performs a certain operation. When multiple tasks are configured, then a container can be used to group them together.
SSIS provides three types of Containers. Here is a brief description about the three Containers. We will deep dive into the Containers later.
1) Sequence Container : This allows us to group multiple tasks together. The benefits of this feature is that we can control the entire group rather that managing each task separately. It also means we can run different tasks sequentially or parallel. The entire group can collapsed or expanded. The Sequence container is the 3rd container in the toolbox
2) For Loop Container : This provides the same functionality as the sequence container but also lets you run tasks multiple times based on the condition provided. The For Loop is the 1st tool in the tool box
3) Foreach Loop Container : This allows looping but instead of a condition the looping happens over objects such as files and folders or tables in a database.
Implementation of Control Flow Task
We will now implement the above by creating and editing a control flow task and executing the package within the SSIS environment. We will be using the same project we created in our previous article for this demo.
Step 1: Open the Project using BIDS -> Select Mypackage.dtsx -> Click on the Toolbox -> Drag and Drop the Execute SQL Task on the Designer Surface. Rename the task as Update Table
Step 2: Right Click on the Task – > Click on Edit -> Change the Connection to AdventureWorks -> Click on the SQLStatement and insert the below query – > Click on OK.
UPDATE Production.ScrapReason SET ModifiedDate = '2014-06-01 00:00:00.000' WHERE name = 'Drill pattern incorrect'
Step 3: click Start Debugging on the Standard toolbar -> If the execution is correct then the task would be green.
Step 4: Click on the Progress tab to view the execution details of the task. -> Stop the execution by clciking on the stop debugging button – > Save the project.
The objective of this article was an introduction to the concept of Control Flow and Tasks with a small demo. I hope I was able to do that. In my next article I will write about Container with a broader perspective.
Tagged: Business intelligence, Control Flow Objects, ETL, Integration, Integration Packages, Integration Services, Microsoft SQL Server, SSIS, SSIS Container, SSIS Tasks, Tasks
[…] understand how we can use a Sequence Container with a demo. In my previous article I wrote about Control Flow Objects in […]