Using variables in multiple packages

  • I have a SSIS Solution built in Visual Studio Community 2019 using SSDT. The solution contains about 15 packages. I am using 5 variables (created in the first package) that I would like to use in all of the other packages. Is there a way to make a variable usable in other packages within the same solution?

  • No. Only parameters can be shared, and only within a project (not across a solution).

    If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.
    See https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help/ for details of how to post T-SQL code-related questions.

  • Okay, thanks.

  • Just to elaborate, if you set up the other packages to run within a master package, you can then pass the variables that way.  If you're using SQL Server 2012 or higher, it's easy to do.  I pass many variables that have been determined by the master package to the child packages.  The master child package setup is considered a best practice approach.

  • RonKyle wrote:

    Just to elaborate, if you set up the other packages to run within a master package, you can then pass the variables that way.  If you're using SQL Server 2012 or higher, it's easy to do.  I pass many variables that have been determined by the master package to the child packages.  The master child package setup is considered a best practice approach.

    You can pass (master) variables to (child) parameters, but you cannot pass variables to variables.

    If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.
    See https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help/ for details of how to post T-SQL code-related questions.

  • Agreed.  Thanks for clarifying.  My use of the terminology was imprecise.  I'll correct the answer later.

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

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