Friday, November 30, 2007

SQL:SSIS registry package configuration

Create two registry key directly under HKEY_CURRENT_USER

Create a SSIS project with two tasks:

Execute Process Task and Data Flow Task

When you define the Execute Process Task, two properties are specified. They are:


After you double-click on the Data Flow task and Navigate to Data Flow pane, you add an OLEDB Connection Manager and set its connection string similar to the following:

Data Source=QUEEN;Initial Catalog=AdventureWorks;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;

Save the SSIS project, click on Control Flow pane, click SSIS menu and select Package Configuration Wizard. This time, choose the Registry as the SSIS Package Configuration Locations.


Then, when you execute your SSIS package, the value of Arguments in Execute Process Task will be replaced by the value of registry MyPackage1. The value of ConnectionString will be replaced by the value of MyPackage2 registry key.

You can run your package with different values without modify your SSIS package.
===

To save the package configuration to database table:

Open the dbo.[SSIS Configurations] table, identify the row with Configuration Filter set to example1, modify the configuredValue, and rerun the package: