none
Passing variables between packages of the same project - SSIS 2012 and superior RRS feed

  • Question

  • Hi,

    I've a SSIS 2012 solution with the project deployment model. This solution has a main package that calls other packages by an execute package task. I need to pass a variable from the main package (the parent one) to the called package (the child one).

    How can I solve this issue? Do I use the Parameter Binding feature of the execute package task? How, please?

    Many thanks

    Wednesday, April 19, 2017 3:24 PM

Answers

  • Hi all, thanks for your reply.

    As I said, I'm using the project deployment model and not the package deployment model.

    I don't want to use a SQL Server table and I prefer to pass some parameters between packages.

    However, I've solved this issue.

    I've done these steps:

    a. creating a parameter in the (called) child package;

    b. creating a variable in the (main) parent package to bind with the child package parameter;

    c. binding the parent package variable with the child package parameter for the Parameter bindings feature of the execute package task;

    d. creating a child package variable to get the value of the child package parameter.

    Thanks and bye 

    • Proposed as answer by Pirlo ZhangModerator Thursday, April 20, 2017 6:44 AM
    • Marked as answer by pscorca Thursday, April 20, 2017 4:52 PM
    Wednesday, April 19, 2017 4:07 PM

All replies

  • I would write the variable outside the package (SQL Table, text file, etc) and I would read it from there but I guess there is some solution more elegant.

    Please mark as answer if this post helped you

    Wednesday, April 19, 2017 3:27 PM
  • Hi ,

    As Diego advised, you can use a table to store values . This way you can check history values .

    More elegant way can be by passing variables from parent package to child package :

    http://microsoft-ssis.blogspot.co.il/2011/06/passing-variables-from-parent-package.html


    Regards, David .

    Wednesday, April 19, 2017 3:50 PM
  • Hi all, thanks for your reply.

    As I said, I'm using the project deployment model and not the package deployment model.

    I don't want to use a SQL Server table and I prefer to pass some parameters between packages.

    However, I've solved this issue.

    I've done these steps:

    a. creating a parameter in the (called) child package;

    b. creating a variable in the (main) parent package to bind with the child package parameter;

    c. binding the parent package variable with the child package parameter for the Parameter bindings feature of the execute package task;

    d. creating a child package variable to get the value of the child package parameter.

    Thanks and bye 

    • Proposed as answer by Pirlo ZhangModerator Thursday, April 20, 2017 6:44 AM
    • Marked as answer by pscorca Thursday, April 20, 2017 4:52 PM
    Wednesday, April 19, 2017 4:07 PM
  • d. creating a child package variable to get the value of the child package parameter.

    Thanks and bye 

    There is no need for this step unless you plan on altering the value, the parameter can be referenced any where the variable is referenced
    Wednesday, April 19, 2017 8:31 PM
  • Hi pscorca,

    Thanks for your reply and sharing the solution.

    If your issue is solved, would you please mark the appropriate answer as Mark as answer if possible? This will help other members to find a solution if they face the same issue.

    Thanks,
    Pirlo Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, April 20, 2017 6:45 AM
    Moderator