Example 6: Package Configuration

This example uses an XML configuration file to specify the SalesPersonID for which to select and output records from the Sales.SalesPersonHeader table. The SalesPersonID is read from the configuration file into a variable. The variable is then used in the WHERE clause to limit records returned from the table Sales.SalesOrderHeader by a T-SQL SELECT statement to a single sales person.

  1. Copy Example5.dtsx following the instructions at the beginning of Example 2: Aggregation, and rename it Example6.dtsx. Open the Example6 package and select the Control Flow designer.

  2. Enable package configuration. Right-click the designer and select Package Configurations... from the context menu to open the Package Configurations Organizer dialog. Click the "Enable package configurations" checkbox.

  3. Click the Add... button to launch the Package Configuration Wizard. Click the Next > button to display the Select Configuration Type pane. Set the "Configuration type" dropdown to "XML configuration file." Set the "Configuration file name" to Example6.dtsConfig. The completed pane is shown in the following figure.

    Package Configuration Wizard: Select Configuration Type

    Figure 46. Package Configuration Wizard: Select Configuration Type

  4. Export the value for the SalesPersonID variable to the XML configuration file. Click the Next > button to open the Select Properties to Export pane. Expand the Variables node, expand the SalesPersonID node, ...

Get SQL Server Integration Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.