Monday, March 26, 2012

Package Variables Not Available at Runtime

Hello,
I have three package variables that I need to have access to at runtime. All three variables have package scope. The first two, 'StartDate' and 'EndDate' are DateTime variables. The third is called FilePath and is a String variable.

I have taken the following steps;

1. Enabled package configurations
2. Set up all three variables as Parent Package Variables, and have targeted the 'Value' property for each.
3. In the properties of the solution, I have set AllowConfigurationChanges to True.
4. After the package was built, I ran the Package Installation Wizard from the Manifest.

I have done both File System and SQL Server installations. When I go to run the package, none of the three package variables are available for modification.

What am I doing wrong?

Thank you for your help!

cdun2

Hi,

You are not doing any thing wrong.

The value you have to set into the configuration file (xxx.dtsconfig file), that has to be read by package, before executing the package.

The configuration file is like name value pair...Name will be created by SSIS, you have to fill the value

You can't modify the variable at runtime, it is updated from the configuration file at runtime.

Thanks

Dharmbir

|||Thank you for your response. Dumb question; Where do I find this file?|||cdun2,
That file is not applicable in your situation.

Phil|||Thanks. What configuration type do I need to set up for these package variables so that I can configure the package variables at run time? Should I be using an XML Configuration file?|||

cdun2 wrote:

Thanks. What configuration type do I need to set up for these package variables so that I can configure the package variables at run time? Should I be using an XML Configuration file?

Well, you can use XML config files (or SQL Server configurations) or you can use the /SET option on the command line.|||Thanks for your help!|||

I think in your case XML config file will be most usefull as it is easily readable.

when you create the config file, path will be mentioned in the wizard.

|||

Dharmbir wrote:

I think in your case XML config file will be most usefull as it is easily readable.

Why?|||

Dharmbir wrote:

I think in your case XML config file will be most usefull as it is easily readable.

when you create the config file, path will be mentioned in the wizard.

I've tried both SQL Server and XML configurations, and I must be missing something. I expected that with one or the other configurations that there would be something in the Execute Package Utility where I would see the package variables that I wanted to update, and then I could basically 'fill in the blanks'.

Now I understand that for the XML configuration files, the file has to be opened and modified directly. In the table I set up for the SQL Server configurations, do I just execute Update queries to modify the values? In the Execute Package Utility 'Set Values' property, I see where I can add the Property Path and its value. It looks like I need to type in the Property Path every time I run the package. Why would I have to do that If I have specifically set up specific package variables in the package configurations?

Thanks again.

|||If package configurations are turned on, then whatever you define in that configuration will get picked up at run time. So, for example, it is common to place the connectionstring parameter of your database connections into the configuration. Updating this parameter (either by editing the XML file, or by updating the configuration table in SQL Server) will cause that associated connection to use the new, updated connectionstring at runtime. You need not pass anything in if the configuration is correct and that you have "configured" the appropriate pieces of information (connectionstring, variable, etc...)

Does that make sense?|||Yes, it makes sense. I just expected some way to interface with the variables other than a direct edit to an XML file or an UPDATE statement against a table. I don't have anything against doing either, I just expected to see the variables expressed in the Execute Package Utility. The interface for the Connection Managers is similar to what I expected for the package variables that I set up in package configurations.|||

cdun2 wrote:

Yes, it makes sense. I just expected some way to interface with the variables other than a direct edit to an XML file or an UPDATE statement against a table. I don't have anything against doing either, I just expected to see the variables expressed in the Execute Package Utility. The interface for the Connection Managers is similar to what I expected for the package variables that I set up in package configurations.

Nope. You can do it in the Execute Package Utility though. Use the /SET command line option: http://msdn2.microsoft.com/en-us/library/ms162810.aspx|||

Phil Brammer wrote:


Nope. You can do it in the Execute Package Utility though. Use the /SET command line option: http://msdn2.microsoft.com/en-us/library/ms162810.aspx

Did you mean the dtexec utility? At least I know how I'm supposed to alter the variable values once they are configured in the package. I'll probably just write a proc to update the SQL SSIS Configurations table that I have.

Thanks again!

cdun2

No comments:

Post a Comment