In this article we will show you, 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 SSIS 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 is it returning.
In order to add XML package configuration, right-click on the control flow region will open the context menu. Please select the Package Configurations.. option from the context menu
Once you select the Package Configurations.., a new window called Package Configurations Organizer is opened as we shown below. Please check mark the Enable Package Configurations to enable the configurations. Next, click on the Add button to add new configuration.
Clicking the Add button, will open a wizard. First page is the welcome wizard, please check mark Don’t shown this page again to avoid this page.
Select Configuration type: Here, we have to select the configuration type. By default XML configuration file is selected by the SSIS.
- Specify Configuration settings directly: By selecting this option, you have to specify the configuration settings directly. It means, you have to select the file that contains the configuration settings (connection manager, or variable value etc). In this example, we will explain about this property. So, click on the Browse button to select the existing configuration file, or to create a configuration file.
- Configuration location is stored in an environment variable: This is an indirect approach. Please refer SSIS Package Configuration using XML Configuration File Part 2 to understand this option.
As you can from the below screenshot, we are creating ExecutepackageConfigFile of type dtsConfig inside our project.
Click the Next button
Select Properties to Export: You have to specify the target value here. This may be variable value, or connection manager settings.
Here we want to replace the connection manager settings inside the package with the XML configuration file. So, let me select the ConnectionString property. It means, default connection string inside the package will be replaced with this config file at run time.
Let me rename the Configuration name as Connection String Configuration, and Click Finish button to close the wizard.
Now you can see our newly created Connection String configuration that holds the connection string information inside the .dtsConfigfile.
Let me open my file system to show the ExcutepackageConfigFile.dtsConfig
and the XML data inside that file is:
You can also edit the config file using the notepad
Here we are changing the Database name from SQL Tutorial to Adventure Works DW 2014
While running the package, it failed because Adventure Works DW 2014 doesn’t had Duplicate Employee table.
Let me change it to SQL Tutorial and run the package
Thank You for Visiting Our Blog