8

Am trying to execute SSIS package with dtexec command line utility.

my syntax for dtexec is as follows:

dtexec /FILE "C:\DirectLoads\RefEDWDirectLoads.dtsx" /Set \Package.Variables    
[User::SourceDirectory].Properties[Value];"C\Test" /Set \Package.Variables
[User::EDWConnection].Properties[Value];"Data Source=hts0476;Initial 
Catalog=EDW;Provider=SQLNCLI10.1;Integrated Security=SSPI;"

when executed its throwing error:

Argument ""\Package.Variables[User::EDWConnection].Properties[Value];Data  
Source=hts0476;Initial Catalog=EDW;Provider=SQLNCLI10.1;Integrated Security=SSPI;""  
for option "set" is not valid.
Sreedhar
  • 29,307
  • 34
  • 118
  • 188

1 Answers1

14

Yes got this fixed as

dtexec /FILE "C:\DirectLoads\RefEDWDirectLoads.dtsx" /Set \Package.Variables
[User::SourceDirectory].Properties[Value];"C\Test" /Set \Package.Variables
[User::EDWConnection].Properties[Value];\""Data Source=hts0476;Initial 
Catalog=EDW;Provider=SQLNCLI10.1;Integrated Security=SSPI;"\"
Sreedhar
  • 29,307
  • 34
  • 118
  • 188
  • Hi, thanks for this Question and answer - when I try the above, from a powershell script, setting a value of a ConnectionString, if I escape quotes like you have it thinks "Data" is a script/cmdlet - if I don't, it says the Set argument is not valid. Any ideas? – SpaceBison Sep 20 '13 at 11:24
  • To clarify, the fix is that the second variable's value needed to be double-quoted. Not just `"Data Source=hts..."` but `\""Data Source=hts..."\"`. –  Sep 09 '15 at 22:34