Variable Visibility

Jul 18, 2009 at 9:29 PM
Edited Jul 18, 2009 at 9:30 PM



I would like to use a variable for audit purposes from a parent package to capture an IO counter. Unfortunately the only variables available in the dropdown are ones defined in the same package as the SCD component. I know that my package has visibility to the parent package variable because I can work with it in event handlers and scripts.  Any suggestion how I could do this?



Jul 19, 2009 at 10:55 PM

Ah - no.  I've not used parent package variables in any of my projects...

Is it possible to create a "local" variable, and assign it the same value by having it Evaluate as Expression?

Jul 20, 2009 at 8:15 PM

Unlike DTS parent package variables are not automatically inherited (visible) to a child package.
This fact, however, does not mean that you cannot pass variable values from a parent package into a child package.

First, in the child package create a new package scoped variable and have a parent package variable that you want to pass.
Next, in the child package create a new package configuration (from SSIS toolbar menu or right click on package menu) using the configuration type of Parent Package Variable and include the full name of the parent package variable (e.g. User::ETLAuditKey)
Lastly, in the target property page of the package configuration wizard select the value property of the variable you wish to store this parent variable value (e.g. value property of a variable named ETLAuditParentKey)


Jul 21, 2009 at 7:30 PM

Thanks, Joe - I haven't had the opportunity to use parent package variables...

Aug 5, 2009 at 10:43 PM

Apologies for the late response - Thank you both - ill give it a shot