Arman S
Arman S

Reputation: 85

Passing parameters to a package from command prompt

I have a ssis package "pkg1" with a variable "var1" which I pass a parameter to it from the command prompt such as

dtexec.exe /f c:\pkg1.dtsx /set \Package.Variables[User::var1].Properties[Value];"test"

In the packages I have a script task which I display the value of the variable

  MessageBox.Show(Dts.Variables["User::var1"].Value.ToString());

When I run this package from the command prompt. The messagebox opens but no value for my variable is displayed.

Upvotes: 2

Views: 3353

Answers (1)

Hadi
Hadi

Reputation: 37313

you are trying to pass a string value which need to be double quoted, you have to add \" at the beginning and the end of value

dtexec.exe /f c:\pkg1.dtsx /set "\Package.Variables[User::var1].Value";\""test"\"

Upvotes: 2

Related Questions