SSIS 2012 项目部署模型为创建环境和配置环境特定值提供了更大的灵活性,这些值可以映射到项目参数。这是一个示例,说明了如何Integration Services Catalog针对多个环境执行部署到的包。理想情况下,生产环境应该在自己的服务器上。为简单起见,此示例使用同一服务器上的所有环境。
具有环境特定值的 SSIS 2012 集成服务目录:
Let's assume that you have deployed a package to Integration Services Catalog with two project parameters named Environment and FilePath. To run the package under different environments, you can create multiple environments under Integration Services Catalogs \ SSIDB \ Folder name \ Environments
This sample has three Environment folders named DEV, PRD and TST

To create variables that should later be mapped to the project parameters, double-click the environment under the Environments folder. This samples shows how to configure values in all environments.
Since, the package has two project parameters named Environment and FilePath, we will create two environment variables of the same name. All the environments are configured with same variable names but with different values.



To map the environment variables to the project parameters, right-click on the project under the Integration Services Catalog and click Configure...

On the Configure dialog, click References page and add each environment which should be associated with the project.

On the Configure dialog, click Parameters page. For each parameter listed under Parameters tab, you need to click the Ellipsis button to map the appropriate environment variable.

On the Set Parameter Value dialog, select Use environment variable radiobutton and choose the appropriate variable. Here the parameter being mapped is [Practice.SSDT].[Environment]. Hence, it is being mapped against the environment variable Environment.

Once you have mapped the parameter against the appropriate environment variable, you can choose the correct environment during package execution. To execute the package, right-click on the package and click Execute...

On the Execute Package dialog, check Environment box and select the appropriate environment from which the package should use the values for execution.

The sample package SO_15206184.dtsx in this example simply inserts the values of project parameters Environment and FilePath into a table. Here are the results of the package execution against different environments, even the one including from within SSDT.
