locked
Parent Child package referencing parent variable from child package RRS feed

  • General discussion

  • Let's start with the problem I would like to solve. I am building a set of packages to download files. I have two methods for downloading files:  SFTP and HTTP using a fixed format.  My plan was a master package that manages getting the configuration for the download, determines which method to use and sends an email notification for the success/failure of the download. There is one package for SFTP and one for the HTTP. So far this is easy.

    I would like to get a list of the files that I am downloading to send back to the master package.  That way I can put all of the code in the master package to handle the list, perhaps adding the list to the notifications.

    I found from my friend Tim Mitchell (https://www.timmitchell.net/post/2015/04/20/using-the-ssis-object-variable-as-a-data-flow-source/) how to read a recordset.  I can populated a recordset in several ways (my test involved using a data flow and recordset destination).

    What I did was to use the recordset destination in my child package.  But here's the thing, the variable I loaded does not exist in the child package.  It is in the master package. My child package showed a big red "error" mark. But when I ran the master package, the recordset loaded as expected and I could retrieve the values from that recordset variable using a for each container or a script component.

    This is a nice to have requirement.  But can anyone see a problem with this approach?

    The main problem is that I won't be able to run the child packages alone.  They will always need to run from the master package.

    I have done this before with a string variable and haven't had problems.  But since I am using an object, I thought I would see if anyone can talk me out of this craziness.


    Russel Loski, MCSE Data Platform/Business Intelligence Twitter: @sqlmovers; blog: www.sqlmovers.com

    Monday, August 20, 2018 8:37 PM