Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 604
  • Last Modified:

Using Set Values and Configurations on a sql agent ssis job

Can you run an SSIS package from a SQL Agent job setting the packages variables by both an xml configuration file as well as setting a certain variable using Set Values by entering something like:

\package.variables[variablename].Value

in property path and the value I want to change to in the Values column?

I basically want my package that has 20 variables listed in the configuration file to run with all the values in that xml file aside from a datetime variable which I want to run with today's date rather than the value in the config file.

Thought I may be able to do it this hoping that Set Values would take precedence over the configuration file.
0
Grffster
Asked:
Grffster
  • 2
1 Solution
 
ValentinoVBI ConsultantCommented:
If you specify both the XML file and the variable assignment through the job, then I'm not sure which one takes precedence.  They will both be accepted, but if values for the same variable are specified through both XML and additional job config, then only one of them will be applicable.
However, if you use Package Configurations to specify the XML file and set the additional variable through the job, then it should work as expected.

Another option that I see, in case you do want to specify both XML file and variable through the job, is to ensure that the variables for which values are specified through the job, are not mentioned in the XML file.
But maybe that's already what you were trying to do?

More info: http://technet.microsoft.com/en-us/library/ms141682.aspx
0
 
GrffsterAuthor Commented:
I don't entirely understand what you mean by:

However, if you use Package Configurations to specify the XML file and set the additional variable through the job, then it should work as expected.

Isn't this what you're describing in your final paragraph? In other words, leave End Date datetime variable out of the xml configuration file so the project runs that, but set it to be today's date in the set values area on the job? i.e. make them mutually exclusive.
0
 
ValentinoVBI ConsultantCommented:
What you describe is indeed what I meant.

What I meant with Package Configurations is that you specify the XML file through configuration in the package itself.  This is done by right-clicking the yellow background in the Control Flow of the package.

But it doesn't really make a difference, you can also specify the XML file in the Configurations tab in the agent job.  Both ways will work.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now