A question was raised on a beta newsgroup earlier today concerning how to use variables across different packages when the Execute Package task is being used. There was some confusion regarding under what circumstances a package can read/write a variable in another package.
The hard and fast rule is this: A child package has access to variables in the parent package (i.e. the package that called it), but not the other way round. A parent package cannot see variables that are defined in a child package.
If you think about variable scope this makes sense. For example, a variable that is scoped to a Foreach Loop container cannot be seen by anything outside of that container. Its the same when the container is a package...remember that packages calling child packages is just an extension of the container hierarchy. A package is in itself a container and is not necassarily the root of a container hierarchy, it is merely a logical unit of functionality for manageability.
There are some caveats to this rule. Not all tasks in a child package have access to variables in a parent package. For example an Execute SQL task can't populate a variable in parent package via the ResultSet tab. [I have opened a bug on this particular scenario and am hoping it will be fixed by RTM - though I doubt it]. The workaround is to populate a local variable and then use a script task to assign the value of that local variable to the variable in the parent package.
Parent package configurations can be used to produce an almost opposite behaviour. They are used to receive values from a parent package IF the package has been called by a parent package. I like to use the analogy that this is like passing ByValue whereas the scenario explained above is a bit like passing ByRef.
This is a short and sweet overview of how variables can be used between packages. If you have any questions, please feel free to post them as a comment.
-Jamie