Thursday, March 22, 2012

Can't Set variable Through Command Line

Hello everyone!

Bit of a problem executing a DTS command from a command line.

I have the following variables defined in my package:

UserVarchar1
UserVarchar2
UserVarchar3

All have a scope of Package, all of the mstrings

The command I'm attempting to run in 1 line is:

DTEXEC /FILE "C:\SSIS Packages\ED-Customers\Package.dtsx"
/SET \Package.Variables[User::UserVarchar1].value;"10"
/SET \Package.Variables[User::UserVarchar2].value;"30719"
/SET \Package.Variables[User::UserVarchar3].value;"BILLTO"

Description: The package path referenced an object that cannot be found: "\Package.Variables[User::UserVarchar1].value". This occurs when an attempt is made to resolve a package path to an object that cannot be found.

DTExec: Could not set \Package.Variables[User::UserVarchar1].value value to 10.

Any idea why?

Thanks for the help!What happens if you try:

\Package.Variables[User::UserVarchar1].Properties[Value];10|||For some reference:
http://blogs.conchango.com/jamiethomson/archive/2007/03/13/SSIS_3A00_-Property-Paths-syntax.aspx|||

How are you validating the path?

Check the path and remember the variables names are case sensitives.

|||

The syntax is wrong.

Check Phil's posts above.

-Jamie

|||I tried that.. Still says it can't assign it the value of 10.

It's case-accurate, in both path and variable names.

Description: The package path referenced an object that cannot be found: "\Package.Variables[User::UserVarchar1].value". This occurs when an attempt is made to resolve a package path to an object that cannot be found.

DTExec: Could not set \Package.Variables[User::UserVarchar1].value value to 10.

Is there something I'm missing in the design of the package, perhaps? All I did was add the variables to the package. Another variable uses these values and evaluates it as an expression. Doesn't seem too complex, yet I'm still miffed about why this won't execute.

Incidently, if I run the package WITHOUT variables, it will in fact run successfully.|||Adam, make sure the scope of that variable is at the package level, not some other component.|||By any chance is the ReadOnly property of the variable set to True? I get the same error if the value is true; if you want ot assign values at run time it should be set to false|||Thanks for the input, everyone! I finally figured it out.

The first reply was correct. I didn't notice .Properties[Value] in the first reply. Don't know how I missed it.

Sorry, it's been one fo those mornings..

Thanks again, everyone!

No comments:

Post a Comment