Get to know this core component of Microsoft SQL Server Integration Services—a vital part of a multi-platform database-access solution
Editor’s Note: This article is excerpted from chapter 3 of Extract, Transform, and Load with SQL Server Integration Services--with Microsoft SQL Server, Oracle, and IBM DB2, by Thomas Snyder and Vedish Shah.
To build your own “database-agnostic” data access solution based on Microsoft SQL Server Integration Services (SSIS), you will need to understand several components, one of which is the SSIS Toolbox. Here we will introduce the SSIS Toolbox and then step you through some of the most commonly used elements or tasks from the SSIS Toolbox component, which are used to create an SSIS workflow.
SSIS Solution Components
Before we get started with SSIS, a quick explanation of the components is in order. A solution is like your main directory, which contains multiple sub-directories. A solution is designated with an .sln extension filename. Within a solution, the project is your main sub-directory and is designated with a .dtproj extension filename. A project is further split into multiple components: packages, connection managers, and so on. You can create multiple projects in a solution, and when you first create your new SSIS project, a new package will be created and presented to you by default. Packages are designated with a .dtsx extension filename. You can add as many packages as you’d like to your project.
The SSIS Toolbox (Figure 1) holds the different elements used to construct an SSIS package workflow. The Toolbox displays components in a categorized form and will display only those tools available for the view you are in. You cannot create your own categories, but you can move tools around and maximize and minimize categories for ease of use. If you choose, you can install additional third-party tools in the Toolbox. Once they are installed, you can right-click inside the Toolbox and click the Refresh Toolbox option to see your newly installed tools.
Figure 1: SSIS Toolbox
By default, the Toolbox is displayed automatically either when a new package is created or when you open an existing package. If you have a difficulty finding the toolbox, you can simply click the SSIS Toolbox button located at the top right of the design window.
The most commonly used elements within a SSIS package are Execute SQL Task, Data Flow Task, Script Task, and Containers. Below we have provided a brief description of each element so that you can start building your package right now to do some basic functionalities, without our help!
Execute SQL Task
The name says it all. This task helps you to execute SQL queries in your preferred connection. Pick your SQL connection; write out your SQL statement; capture result sets, if any; pass in parameters, if any; or set up your expressions to run dynamic SQL statements that would be evaluated during runtime.
Data Flow Task
A Data Flow Task lets you set up data transformation and cleansing between your preferred sources and destinations.
This task, shown in Figure 2, lets you write C# or Visual Basic code to perform actions that are not executable using the standard SSIS tasks—for example, to gather detailed file information about a file you are trying to process using your SSIS package.
Figure 2: Script Task component, which is used to pull file information and, further down the pipeline, save that information into a database table
Containers (Figure 3) let you loop (For or For Each) through your data set to perform required actions. It also lets you organize your SSIS package workflow into controlled sets that are easier to understand as a single entity.
Figure 3: Containers showing separation of file tasks and member tasks