Chapter 30. Making a Task Dynamic with Expressions

When you consider the many places expressions can be applied, you begin to see how highly adaptable SQL Server Integration Services (SSIS) truly is. The previous lesson discussed the way expressions could be used to make connections dynamic. This lesson now turns to the use of expressions in tasks. Using expressions in tasks gives an SSIS developer the ability to alter individual properties within a task at runtime. A common example is using the Send Mail Task with an expression to populate the subject line to be unique based on the results of your package.

In Lesson 17 you learned about the Derived Column Transform and many of the common functions used in expressions. This lesson focuses on using expressions in tasks, so if you want a recap on the expression language itself, refer to Lesson 17.

You set up a task to use expressions exactly the same way you configure connections to use expressions. To configure a task to take advantage of expressions, select the desired task and press F4 to open the Properties window. Find the Expression property and click the ellipsis (...) next to it, shown in Figure 30-1. This action opens the Property Expressions Editor where you can select to which property inside the task you would like to add an expression. Once you have selected the property from the drop-down box, click a second ellipsis in the Expression property to open the Expression Builder. Here you can begin building your expression ...

Get Knight's 24-Hour Trainer: Microsoft® SQL Server® 2008 Integration Services now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.