Optional command line parameter RRS feed

  • Question





    I want to use an optional parameter at the command line for my package.

    I planned to make the first task a script which simply checks the variable (which is a string),  and if it is empty, go one way, and if it is not, go another way.  Is the best to go?


    Many thnaks in advane


    Tuesday, January 17, 2006 10:46 AM

All replies

  • Use the SET option. It is documented in BOL and there is even an example doing exactly what you want to do (i.e. set a variable from the command-line).




    Tuesday, January 17, 2006 11:30 AM
  • Not sure how you plan to have the script task direct you one way or another. A better method is to use a variable, set as Jamie mentions, and do the which way bit on a workflow constraint, using an expression.
    Tuesday, January 17, 2006 12:05 PM

    Thanks for your replies.


    I planned to use the SET command.  I could then inside my script task inspect the variable, and if it was populated, then set a flag to use in my workflow constraint.

    However, as suggested, I could set up an empty container, and then just inspect the parameter passed in there in my constraint beteen my dummy task and the following tasks, to redirect the flow.  It is just that this has to happen before any tasks have been run, and I wan't sure how this is best acheived.


    Thanks again





    Tuesday, January 17, 2006 1:42 PM
  • An empty sequence container will work as a host for the constraint. Just collpase it and give it a nice name so you can easily see what it is there for.
    Tuesday, January 17, 2006 1:46 PM