SSIS Package Configuration using XML Configuration File

How to apply SSIS Package Configuration using XML Configuration File with example? We already explained the list of Package Configurations in our previous article. So, please refer to the Package Configuration to understand the same.

SSIS Package Configuration using XML Configuration File Example

Before we start SSIS package configuration using XML Configuration File, let me execute the package and see what it returns.

SSIS Package Configuration using XML Configuration FIle 1

To add XML package configuration, right-click the control flow region to open the context menu. Please select the Package Configurations.. option from the context menu.

SSIS Package Configuration using XML Configuration FIle 2

Once you choose the Package Configurations.., a new Package Configurations Organizer window opens. Please checkmark the Enable Package Configurations to enable the configurations. Next, click the Add button to add a new SSIS Package Configuration using XML Configuration File.

SSIS Package Configuration using XML Configuration FIle 3

Clicking the Add button will open a wizard. The first page is the welcome wizard page. Checkmark Don’t show this page again option to avoid this page. Please refer to the below examples for the remaining package configurations.

  1. Environment Variable
  2. Parent-Child Package Configuration
  3. Registry Entry
  4. Server Configuration
  5. XML Config File in Environment Variable
SSIS Package Configuration using XML Configuration FIle 4

Select Configuration type: Here, we have to select the configuration type by default, the XML configuration file chosen by the SSIS.

  • Specify Settings directly: By selecting this option, you have to specify the configuration settings directly. You have to select the file containing the configuration settings (connection manager, variable value, etc.). In this example, we will explain this property. So, click the Browse button to select the existing file or create a configuration file.
  • Configuration location is stored in an environment variable: This is an indirect approach. Please refer to SSIS Package Configuration using XML Configuration File Part 2 to understand this option.
SSIS Package Configuration using XML Configuration FIle 5

As you can see from the below screenshot, we are creating ExecutepackageConfigFile of type dtsConfig inside our project.

SSIS Package Configuration using XML Configuration FIle 6

Click the Next button.

SSIS Package Configuration using XML Configuration File 7

Select Properties to Export: You have to specify the target value here. It may be a variable value or connection manager setting.

SSIS Package Configuration using XML Configuration File 8

Here we want to replace the connection manager settings inside the package with the XML configuration file. So, let me select the ConnectionString property. The default connection string inside the package is replaced with this config file at run time.

SSIS Package Configuration using XML Configuration File 9

Let me rename the name as Connection String Configuration and click the Finish button to close the wizard.

SSIS Package Configuration using XML Configuration File 10

Now you can see our newly created Connection String configuration, which holds the connection string information inside the .dtsConfigfile.

SSIS Package Configuration using XML Configuration File 11

Let me open my file system to show the ExcutepackageConfigFile.dtsConfig

SSIS Package Configuration using XML Configuration File 12

and the XML data inside that file is:

SSIS Package Configuration using XML Configuration File 13

You can also edit the config file using the notepad

SSIS Package Configuration using XML Configuration File 14

Here we are changing the Database name from SQL Tutorial to Adventure Works DW 2014

SSIS Package Configuration using XML Configuration File 15

While running, the package failed because Adventure Works DW 2014 doesn’t have a Duplicate Employee table.

SSIS Package Configuration using XML Configuration File 16

Let me change the value to SQL Tutorial. Next, run the SSIS Package Configuration using the XML File package.

SSIS Package Configuration using XML Configuration File 17