SSIS: Nested tasks

Combining tasks to perform complex, iterative actions.

In this example, I’ll illustrate how combine tasks by nesting one inside the other.
This package will iterate through text files and display the name of each to the user.

As I explained in my Overview of Variables article, I’ll begin by adding an new Package Level variable and naming it Filename.

Next, I’ll drag a ForEach Loop Container Control Flow item unto the designer and configure it to loop through text files in my source folder.

For its Variable Mappings, I’ll select the Package-level variable I added in the first step.

2-ssis-nested-tasks

Now I’ll drag a Script Task into the ForEach Loop Container configure its ReadOnlyVariables to use the package-level variable.

I’ll program the script to display the name of each file in my sources folder.

4-ssis-nested-tasks

5-ssis-nested-tasks

By executing my package, each file found in my source folder is displayed to me in a pop up window.

6-ssis-nested-tasks

7-ssis-nested-tasks

8-ssis-nested-tasks

9-ssis-nested-tasks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s