Why is “Use environment variable” option disabled/grayed out in SSIS2012 catalog configuration?

删除回忆录丶 提交于 2020-12-01 09:30:05

问题


This may sound like an easy question but the answers on the net all point to the basics of setting up an environment and referencing it in the project/package.

The scenario that I have encountered was never mentioned anywhere so I thought it would be good to document the behaviour here.

Below is the steps to reproduce the problem:
1. Create a new package: Package1.dtsx
2. Create a new (package) parameter: Test, Int32, Required
3. Deploy the project.
4. Goto Integration Services Catalogs and navigate to the package.
5. Right click on the package and then Configure...
6. Click on "..." next to the package parameter Test
7. You will see that "Use environment variable" option is disabled/grayed out.

Set Parameter Value

Why is that?


回答1:


Before you can map them together, you have to click References and Add the Environment that you created for that package, then it will be enabled for you.




回答2:


Most answers from blogs and forums will now say that you need to create an environment and link it to the package, blah, blah. However, none of them mentions the fact that in order for the option to be enabled, you must have variables with MATCHING DATA TYPES!

Allow me to demonstrate.

  1. Create an environment: Demo
  2. Create a variable: Test, String
  3. Notice that the data type of the environment variable is different to the package paramter.
  4. Link the environment Demo to the package Package1.dtsx
  5. This is where most answers on the net stop. If you have done what I've told you to do up until now, your "Use environment variable option is still disabled/grayed out. Why? Because the data types are not matching. IMPORTANT - variable names don't have to match, only the data types.
  6. Now let's finish it. Go back to the environment and create another variable that's Int32: Aha, Int32, 0
    Environment Variables
  7. Go back to Configure... and click on "..." next to the package parameter Test
  8. See how the "Use environment variable" option is now enabled? Use environment variable option is enabled


来源:https://stackoverflow.com/questions/22775967/why-is-use-environment-variable-option-disabled-grayed-out-in-ssis2012-catalog

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!