Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Run a child package with its own configuration file from a parent SSIS package


Run a child package with its own configuration file from a parent SSIS package

Author
Message
Griffster
Griffster
Old Hand
Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)

Group: General Forum Members
Points: 351 Visits: 713
I have child package I wish to call from a parent package. The child package runs off a configuration file. Assuming I have to put an execute package in to the parent package to call the child, how do I attach a particular configuration file to the child package? I need the child package to be runnable on its own too, hence the need for it to have its own configuration file.
wschampheleer
wschampheleer
SSC Eights!
SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)

Group: General Forum Members
Points: 870 Visits: 303
I'm not sure I fully understand your question, but here's nonetheless a first attempt at answering it.

You are right that you will need an execute package task to run the child package from its parent.

In the child package, you should use package configurations. The important thing to know here is that package configurations can set a variable or property multiple times where the last setting wins. If a configuration fails (either because the variable or property it is trying to set does not exist or - in the case of a configuration of type "Parent Package Variable" - the parent package variable does not exist), this will give a warning but this will not hinder your package executing.

If the configurations are the same for both packages, you could use the same configuration file (or same configuration filter in case your configurations are stored in a database) for the child and the parent package.

If the configurations are different, you have several options:

- use different configuration files (one for the parent and one for the child)
- use the parent configuration file in both packages, but then overwrite some values with settings specific to the child package using a second configuration file that is specific to the child and that is read after the first one

If the settings in the child package are different depending on whether it is executed on its own or called from the parent package, you would do as above, but add a final configuration where you overwrite some values using Parent Package Variables. If the child package is executed on its own, the parent variables are not defined and this step will have no effect (you will see a warning though).

PS: You can turn these warnings off, but you are discouraged to do this in a production environment.

Regards,

Willem
http://wschampheleer.wordpress.com
Griffster
Griffster
Old Hand
Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)

Group: General Forum Members
Points: 351 Visits: 713
wschampheleer (2/22/2010)
I'm not sure I fully understand your question, but here's nonetheless a first attempt at answering it.

You are right that you will need an execute package task to run the child package from its parent.

In the child package, you should use package configurations. The important thing to know here is that package configurations can set a variable or property multiple times where the last setting wins. If a configuration fails (either because the variable or property it is trying to set does not exist or - in the case of a configuration of type "Parent Package Variable" - the parent package variable does not exist), this will give a warning but this will not hinder your package executing.


Ok, understood. However, if I'm setting up a child package to be run via an execute package task in the parent, I don't get the option to use a particular configuration file. If the parent package overrides the child package then that's fine, I'll just place the same variables in my parent package and place them in the parent's configuration file.

If the configurations are the same for both packages, you could use the same configuration file (or same configuration filter in case your configurations are stored in a database) for the child and the parent package.

If the configurations are different, you have several options:

- use different configuration files (one for the parent and one for the child)
- use the parent configuration file in both packages, but then overwrite some values with settings specific to the child package using a second configuration file that is specific to the child and that is read after the first one.


Think I see what you mean here, however, as I can't see how you can apply a configuration file in an execute package task how do you apply the different configuration file to the child? Could it be that in the parent, when you set up package configuration files in the parent (SSIS > Package Configurations...) that you add them in there in order you want them to apply? e.g. if you had a configuration file for the child setting variable var1, and the parent package configuration file sets values for variables var1, var2, var3, then you place two configuration files in there, one for var1 in child and the second to be var1 to var3 in the parent. The var1 in the second configuration (parent) file overwriting the var1 in the first (child config) file?


If the settings in the child package are different depending on whether it is executed on its own or called from the parent package, you would do as above, but add a final configuration where you overwrite some values using Parent Package Variables. If the child package is executed on its own, the parent variables are not defined and this step will have no effect (you will see a warning though).

PS: You can turn these warnings off, but you are discouraged to do this in a production environment.

wschampheleer
wschampheleer
SSC Eights!
SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)

Group: General Forum Members
Points: 870 Visits: 303
You can use package configurations in both the parent and the child package independently. The configurations for the child package should be defined in that package, not in the parent package or through the execute package task (which is indeed not possible).

Regards,

Willem
http://wschampheleer.wordpress.com
Griffster
Griffster
Old Hand
Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)

Group: General Forum Members
Points: 351 Visits: 713
wschampheleer (2/22/2010)
You can use package configurations in both the parent and the child package independently. The configurations for the child package should be defined in that package, not in the parent package or through the execute package task (which is indeed not possible).


Sorry, I wasn't being clear I think. My current scenario is this:

I have a package which uses a particular configuration file. This has been running independently as two separate sql agent job for a number of months now. There are two separate jobs as one uses the original configuration file as set up in BIDS, and the other uses another file with different values.

I now have another package (the parent) which, as part of its run, needs to run the above package (the child).

I'm currently in development of the parent, but it's highly likely I will have other variables that I need to add to the parent package's configuration file.

Are you saying that, if I wanted the child package to run with different values to those in the child's original package configuration file setup in BIDS, then I need to add the same variable names in to my parent package as in my child configuration file and these will filter down in to the child when it runs as part of the parent?
wschampheleer
wschampheleer
SSC Eights!
SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)

Group: General Forum Members
Points: 870 Visits: 303
You can reuse the child's configuration file in the parent and then add extra configurations in the parent package (e.g. you can have more than 1 configuration file in a package; if a value or property is set more than once, the latest setting wins).

The configurations will not filter down from parent to child. If you want this to happen, then you need to define configurations of the type "Parent Package Variable" in the child. The name of the variable does not have to be the same in both packages.

Regards,

Willem
http://wschampheleer.wordpress.com
Griffster
Griffster
Old Hand
Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)

Group: General Forum Members
Points: 351 Visits: 713
wschampheleer (2/22/2010)
You can reuse the child's configuration file in the parent and then add extra configurations in the parent package (e.g. you can have more than 1 configuration file in a package; if a value or property is set more than once, the latest setting wins).

The configurations will not filter down from parent to child. If you want this to happen, then you need to define configurations of the type "Parent Package Variable" in the child. The name of the variable does not have to be the same in both packages.


Mmm. If I change the package configuration for the child to be parent package variable in BIDS, won't this then mean that I cannot run the child independently?
Elliott Whitlow
Elliott Whitlow
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 6990 Visits: 5314
You need to be careful reusing configuration files, if the file refers to an object that does not exist in BOTH packages then it throws an error (or might be an error, can't remember), but it throws something so I didn't ever share. Any data that the child package needed was passed from Parent Package Variables.

CEWII
Griffster
Griffster
Old Hand
Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)Old Hand (351 reputation)

Group: General Forum Members
Points: 351 Visits: 713
Where do you set up the parent package variable in configuration files? In the child via BIDS or the parent?
wschampheleer
wschampheleer
SSC Eights!
SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)SSC Eights! (870 reputation)

Group: General Forum Members
Points: 870 Visits: 303
In the child via BIDS.

Regards,

Willem
http://wschampheleer.wordpress.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search