June 12, 2012 at 7:17 pm
Hi
I hace created a simple SSIS package with a project paramenter DBName which contains the Initial Catalog value for one of the connection managers (assigned via expression (@[$Project::DBName]). When I execute this package then it works ok (I can fail it by assigning the project parameter an invalid database name).
I deployed the package to the catalogue and then configured the project parameter to an environmnet variable (also called DBName). However when I execute the package via SSMS an execute dialog box appears the following error is diaplayed
"The parameter DBName is configured to use an envionment variable but no environment has been selected. Check the environment checkbox and specify the environment to use or specify a literal for the parameter"
At the bottom of the dialog box the "Environmnet" checkbox is unticked and the correct environment is grayed out. When the tick the checkbox and select OK then the package runs ok
Not sure what I am doing wrong here
Regards
Tim
June 13, 2012 at 12:31 am
When you link your project to an environment variable, you need to choose one before you start the package. It will not take one by default. It's up to you to specify which environment will be used when running the package.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
June 13, 2012 at 12:35 am
Thanks for that, so how does one automatically specoify the environment to use when executing via the sql agent
June 13, 2012 at 12:39 am
I'm not on my machine with SQL Server 2012 right now, but I can remember you can configure the environment in the SQL Server Agent jobstep. Quite similar on how you had to click the checkbox. This means that the Agent job will always use the specified environment.
If you want to switch between environments dynamically, you need to execute the package with TSQL.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply