The Integrartion Services package is actually a collection of object properties, in all the Integration Services packages we developed before, the variables, attributes, such as database links, synchronized file directories, etc., we directly use a constant in the package to assign these variables or attributes, which brings great trouble to the release and migration of this package, such as when we develop packages in the development environment. All variables and attributes are set according to the development environment, after the development is completed, to deploy this package to the production environment, DB connection, synchronization directory, etc. will change, the previous method: open the package in the new environment, reset the values of these variables or attributes, before it can run normally. Since Integration Services 2005, this problem has been solved with the addition of the [Package Configuration] feature. Profiles help package transfer seamlessly, and the configuration process can be automated, reducing deployment hassle and risk of errors.
The package configuration of the Integration Services program allows any SSIS attributes such as packages, connections, containers, variables, etc., to be written to an XML file or table and then read at runtime. There are several main types of configuration:
- XML configuration file
- environment variable
- Registry keys
- Parent package variable
- SQL Server tables
On the Project menu, select Convert to package deployment model, as shown in the following image:
In the SSIS package, enable the package configuration, right-click on the blank space of the package, and select the package configuration, as shown in the following figure:
Check the Enable package configuration, select the XML configuration file, click Browse, and fill in the configuration name according to your situation, as shown in the figure below:
The server addresses of the source and destination are configurable, as shown in the following figure:
Finally, an SSIS package configuration example is generated: configuration file.dtsConfig
Generate the XML configuration code as follows:
Try to modify the server address to the wrong address, use DTExecUI to select the xml configuration file, re-execute the package, and the error is as follows:
(End)
|