-1

I'm using SQL Server 2012 & MS Visual Studio 2010

I have a DTS package with a user variable, PO (string), and I'm trying to execute a sql command using that variable, so I've set up another variable to build the sql string.

The problem is, that when I try to run the package using the DTEXEC utility with /SET, the package is ignoring the variable value I'm sending.

Command I'm using:

dtexec /server myserver /sql MyPackageName /U user /P password /SET "\Package.Variables[User::PO].Properties[Value]";"AE-J067329-01"

The expression for SQLStringVar is "exec my_procedure '" + @[User::PO] + "'"

However, the results show SQLStringVar as evaluating to "exec my_procedure ''" , or whatever value I put for the initial value for the User::PO variable. The package runs without errors.

Jeff
  • 12,555
  • 5
  • 33
  • 60
Dan
  • 3
  • 2

1 Answers1

0

I figured it out: In the Package Explorer tab...Variables.

Right-click the variable, go to Properties, and change EvaluateAsExpression to False.

(This was driving me nuts since, when editing the variable using the Variables tab, this property is not available)

Dan
  • 3
  • 2