How to pass in a user variable value to an SSIS package from TSQL?

  • Hi All. We have some SSIS packages we call from stored procs. We're switching from dtexec to the the new 2012 create_execution/start_execution method.

    Our packages have user variables (not parameters) that need to be set at run time. I can't figure out how to pass in the values. I see set_execution_parameter_value, but that only seems to work for parameters. It's easy with dtexec, so I assume there must be a way. Thanks for any guidance.

  • It's been over a year since I looked into this but during a migration from 2008 R2 Package Deployment model to 2012 Project Deployment model I seem to remember having to convert those to Package Parameters so they'd be settable using the procs.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • I think that you can do it using catalog.set_execution_property_override_value.


  • Phil Parkin (2/19/2016)


    I think that you can do it using catalog.set_execution_property_override_value.

    Good call. You can.

    I remember now..I explicitly went towards promoting everything we used to set on the dtexec command line to Package Parameters because since the packages are called as part of a framework and the Package Parameters made for a more declarative API as opposed to relying on Variables. Microsoft recommends using Package Parameters to accept inputs since they are explicitly added to the SSISDB when you deploy project, unlike Variables. In planning for a UI to compliment the ETL Framework, having the Package Parameters in place will be easier to expose whereas Variables would not be. You can see this effect when you go to execute a Package in SSMS. The Package Parameters are detected and easily overridden while you need to manually key in the Package Path to each variable you want to set at runtime.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

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

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