posted on Friday, April 15, 2005 11:22 PM by Knight_Reign

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
 

Comments

# re: Package command line configurations... @ Monday, March 12, 2007 6:33 PM

I can't seem to the get the syntax right. I have a global var called db_servername in the namespace ConnStr. Here's the cmdline and the output :

H:\Visual Studio 2005\Projects\Feed Processing IS>dtexec /FILE "H:\Visual Studio 2005\Projects\Feed Processing IS\Packages\Import_JPM.dtsx" /SET \Package\Import_JPM.Variables[ConnStr::db_servername].Value;"localhost"
Microsoft (R) SQL Server Execute Package Utility
Version 9.00.1399.06 for 32-bit
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.

Started: 6:32:54 PM
Warning: 2007-03-12 18:32:55.09
Code: 0x80012017
Source: Import_JPM
Description: The package path referenced an object that cannot be found: "\Package\Import_JPM.Variables[ConnStr::db_servername].Value". This occurs when an attempt is made to resolve a package path to an object that cannot be found.
End Warning
DTExec: Could not set \Package\Import_JPM.Variables[ConnStr::db_servername].Value value to localhost.

help!!

evan (ny)