Friday, April 15, 2005 - Posts

Package command line configurations...

I've been seeing questions about this and although I've posted about configurations before, here command line configurations are a bit different.

There are some cases where you wish to pass values for properties directly on the command.

Here is how to do it:

DTExec /f PackageName.dtsx /set \Package\ForLoop\Sequence.Variables[VariableName].Value;VariableValue

This package path (bold) points to the variable named “VariableName“ defined on a sequence named “Sequence“ inside a ForLoop container named “ForLoop“.

Containers are delimited by the '\' token. Properties are delimited by a period. And indexes into collections are delimited by brackets [].

Another way to easily figure out a package path is to create an XML configuration to a property and then copy the package path directly from the configuration file. For example, an XML configuration to configure a package with a variable called “test“ at package scope would look something like this:

<Configuration ConfiguredType="Property" Path="\Package.Variables[User::test].Value" ValueType="String"><ConfiguredValue>Default</ConfiguredValue></Configuration>

Cut the “Path“ portion out of the file and paste it into the command line, and you can configure the variable through DTExec.

DTExec /f MyPackage /set \Package.Variables[User::test].Value;“This is the new value of the variable“

Universe.Earth.Software.Microsoft.SQLServer.IS.KirkHaselden