2
votes

I'm hopeful one of you guys can help me with the following question.

Question: Is it possible to pass command line arguments to a package when running it from within Visual Studio/BIDS?

I want to set the value of a variable via the command line, and found that you can to this in DtExec with the "/set \Package.Variables[...].Value;..." syntax. According to the docs, you should be able to pass the same argument via the 'CmdLineArguments' property in the 'Properties' dialog of an SSIS project in VS

  1. Right click on your project (make sure you do this on project not package)
  2. hit properties
  3. and go down to your debugging section

    (CmdLineArguments will Run the package with the specified command-line arguments, but unfortunately, this doesn't seem to work (even though the exact same argument does work when running the package externally with DtExec or with DtExecUI)

This makes debugging this package for me a living nightmare... :-/ I found a post on MSDN claiming this doesn't work in the IDE.... Does anybody have any experience with this? Is this a bug? Any workarounds?
2

2 Answers

1
votes

You will not be able to use the CmdLineArguments in Visual Studio\BIDS. This CmdLineArguments is mainly for other development projects such as Windows/Console.

When you debug in Visual Studio\BIDS it is not running dtexec where the parameter is specific to running packages with specific paramters.

For testing you just need to set a value in the package variable. Test your package and make sure everything is working.

You can then pass value to the package variable and replace the default value using Dtexec.

/SET \package.Variables[User::param].Value;"test string"

0
votes

Have you tried creating a variable that is populated by expression to mirror the property setting? Then you could set a watch for it in the debugger.