Welcome to blogs.conchango.com Sign in | Join | Help

Welcome to blogs.conchango.com

SSIS Junkie

SSIS: Configurations or command-line parameters?

Dynamically changing a SQL Server Integration Services (SSIS) package at runtime is something many SSIS designers will find themselves doing. There are a number of methods of doing this and I've covered the main ones already:

Configurations and command-line parameters provide very similar functionality so the question is, when should each of them be used?

Configurations would typically be used when the values that you are passing into your package do not change very often. The obvious example would be where we are moving our packages between different environments and for each environment we need to specify different server names for our data-flow sources and destinations.

Command-line parameters are ideal for situations where the value passed into the package can change often, perhaps on an ad-hoc basis. For this reason it is not possible to know prior to executing the package what value is required to be passed to the package - hence a configuration will not suffice (I have heard talk of another application editing the configuration file before executing a package but this would definately come under my own category of "Worst Practises"). Command-line parameters would be ideal for when an SSIS package is called on an ad-hoc basis by another process. For example:

  • An ISV wants to incorporate SSIS functionality into their product but certain functions in that package can only be carried out by certain users of the product. In this situation the product could pass in the current user's ID which the package can then use to check an external table to see if that user has permission to use the functionality provided by the package.
  • File paths for flatfile connection managers change on an ad-hoc basis and we want to pass in the path when the package is executed.

Make sure that you understand where command-line parameters & configurations should and should not be used. They're mightily powerful tools to have at our disposal.

-Jamie

 

Published 17 May 2005 16:24 by jamie.thomson

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Neal said:

I have an SSIS package which has both Configurations and Command Line Parameters.  I pass a command line parameter which is suppose to set a variable which gets used to read a Configuration.  It appears, though, that the configurations get read first and then the parameters get set.  Is there any way around this?

September 13, 2007 20:34
 

GBaksh said:

I'm using a combination of both: Configurations and Command Line Parameters in the following scenario: I've a package that will refresh my SSAS cubes on a given database. All cubes reside on the same OLAP server but they are under different DB. So I use all the connection strings etc. as SQL Server Configuration where as the Database Name is passed on the command line.

January 23, 2008 19:52
 

siddhugreat said:

How to use both config file and command lin parameter

March 7, 2008 12:17
 

HHiggs said:

I am having problems using multiple configurations.

I have a connection string for a child package defined as:

    @[User::CRDirectory] + @[User::PackageCRSisdomDrive]

Each of these variables is blank in the parent package, and populated by a config file at run time

There are 3 config files.  CRDirectory is specified in the config file listed first in the agent job, and PackageCRSisdomDrive is in the second config.

CRDirectory is given the value:

    E:\Mirror_Files\DEV\GOODIES\COMMON ROUTINES\

PackageCRSisdomDrive is given the value:

    CR_Sisdom_Drive.dtsx

The error message from the job is:

    Error 0x80070003 while loading package file "E:\Mirror_Files\DEV\GOODIES\COMMON ROUTINES\". The system cannot find the path specified.

The command line in the job is:

    /FILE "E:\Mirror_Files\DEV\SOLUTIONS\Daily_Tower_Data_Quality\Daily_Tower_DQ_Parent_Pkg.dtsx" /DECRYPT  /CONFIGFILE "E:\Mirror_Files\DEV\GOODIES\DEV_Environment.dtsConfig" /CONFIGFILE "E:\Mirror_Files\DEV\SOLUTIONS\Daily_Tower_Data_Quality\DEV_Daily_Tower_DQ.dtsConfig" /CONFIGFILE "E:\Mirror_Files\DEV\SOLUTIONS\Daily_Tower_Data_Quality\DEV_DTS.dtsConfig" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING E

I've checked and re-checked all the obvious things like spelling mistakes.

The only thing I can think of, is that the package isn't added into the project.  I didn't want to do this as it creates a copy in the directory the rest of the project is in.  The package will be a common routine called by a number of jobs, and I don't want spurious versions kicking around.

Any ideas, anyone?

TIA

March 12, 2008 11:13
 

jamie.thomson said:

HHiggs,

It looks as though @[User::PackageCRSisdomDrive] is not getting populated.

I'm looking at the command-line that you issued. Some of it has been chopped off due to HTML formatting or something but I can see the whole command-line on the email that I received upon you posting your comment. I admit, it does look fine to me.

I'm a a loss if I'm honest. Does it successfully populate @[User::PackageCRSisdomDrive] if you only specify that 1 config file?

-Jamie

March 12, 2008 13:26

Leave a Comment

(required) 
(optional)
(required) 
Submit

This Blog

Syndication

Powered by Community Server (Personal Edition), by Telligent Systems