Possible to send parameter value into an SSIS package using TSQL?

  • I have a pkg where I want to call it and set the value of its global ssis variables with values passed in as parameters from the call. How do I do this inside the package?

    EX pkg name is MyPkg.dtsx

    Would call it as follows

    Exe MyPkg.dtsx ArgValue1, ArgValue2

  • Don't think you can do that.

    What you can do instead is use package variables, and have the package configuration reading from a table. Then, before executing the SSIS package, set the value of those variables in the configuration table.

  • dndaughtery (9/8/2011)


    I have a pkg where I want to call it and set the value of its global ssis variables with values passed in as parameters from the call. How do I do this inside the package?

    EX pkg name is MyPkg.dtsx

    Would call it as follows

    Exe MyPkg.dtsx ArgValue1, ArgValue2

    You can definitely do that. Read up on the dtexec utility, which allows you to execute a package through the command prompt, and also set the values of any user variables in your package.

    When you successfully get that to work, then it is as simple as using the xp_cmdshell stored procedure to execute the shell command.

    In fact, I have created a stored procedure that does all that work for me...because we sometimes have to execute a package in 32-bit mode.

    Hope this helps.

    Martin.

  • Many Thanks Martin.

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

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