Run OS script, .;bat or Perl from SSIS paskage

  • Hello SQL experts.

    I need to run an executable called abc.exe which I wrapped into .bat script to pass some parameters - wrapper.bat Par1 Par2 Par3

    Par1 - start time

    Par2 - end time

    Par3 - file name where the data is extracted

    I need dynamically pass parameters to the script and run it from SSIS package

    I tried Execute Process Task, but it did work.

    Could you please help?

    Regards,

    Pit.

  • Hi,

    Instead of wrapping it into .bat file, did you try running abc.exe through Execute Process task with the Arguments that you will assign through variables?

    Regards,

    Sahin.

  • Sahin Kaya (1/28/2009)


    Hi,

    Instead of wrapping it into .bat file, did you try running abc.exe through Execute Process task with the Arguments that you will assign through variables?

    Regards,

    Sahin.

    Thank you Sahin. I tried your suggestion and it worked. But for now I hardcoded all my parameters like:

    abc.exe -s"par1" -e"par2" -f"par3" - this is the syntax I have to follow.

    Par1 - start time

    Par2 - end time

    Par3 - file name

    in Executable field I put - abc.exe

    in Arguments field I typed - -s"01/01/2009" -e"01/10/2009" -f"filename.dat"

    Could you explain how to substitute these parameters with dynamic variables?

    Regards,

    Pit.

  • On the Expressions page enter the Arguments expression i.e.

    "-s" + @[User:par1] + " -e" + @[User:par2] + " -f" + @[User:par3]

    Where par1, 2 & 3 are the declared variables

    -------------------------------------------------------------------------
    Normal chaos will be resumed as soon as possible. :crazy:

  • Great, thanks! It all works fine now.

    I would've done the same on UNIX in 5 min! UI layers drive me nuts! 🙂

    Thanks for your help!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply