Global User Variable Scope

  • Hello,

    I have a main SSIS package that contains and runs multiple other packages. In my main (container) package I have a user variable declared with this main package's scope. My goal is to run another package from within my main package, and this other package will set the variable's value by running a Execute SQL Task and assigning it through the ResultSet. What I am finding though is that I can not assign to the variable as it is declared in the main package and not the current one.

    Can a "global" variable be set to be used by all packages within a container package?

    Thanks

  • I don't think you do this. I could be wrong. I think you could hack it together by writing the value out to a table or file and then reading it in the Parent package.

    Lookup Package Configurations on-line to see if it is possible.

  • Hi There,

    If I understand correctly you want child package to inherit values from master package ? If Yes, 2 Solutions.

    1) Use Execute package task in Master pkg, in Child when you go to Package Configuration, there is option to inherit from parent package enable that. You will find more information about this on Microsoft Page.

    2) Use Script task, which give you flexibility to either execute package as file with parameters or execute in SQL Server. You can find the reference code in : http://www.codeproject.com/kb/database/callssisfromcsharp.aspx

    Hope these information are helpful.

    Raj 😉

  • Ok, thanks for the information. I will look into the two possibilities that you mention.

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

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