Friday, December 17, 2004 - Posts

SSIS Variable Scope - Some clarifications II

The reason we have parent package variable configurations is to decouple packages so it's possible to execute/debug the child package without the reference to parent package. However, it's still possible to have a child package modify a variable value in a parent package.

It's easy, just reference a variable in the parent package. If you create a variable on any ancestor of a container, it's visible to the child.
This still holds true for child packages. They are children of the taskhost container of the Execute Package Task that launches the child package.

I've created a couple of packages that do this. There's a deployment bundle at the link below that contains two packages, a parent package that has a variable ("FooVar") of type string and a child package that changes that variable. The parent contains a couple of script tasks that show message boxes with the values of the the variable before and after the child package changes it.

There is a connection that points to the child package, make sure when you deploy this to change the connection string property to the directory where you've dropped the child package.
Get the packages here.

Let me know how this works for you.

Universe.Earth.Software.Microsoft.SQLServer.IS.KirkHaselden

A little too much reminiscing...

Euan's post here brings back some of the memories I'd much rather forget...

The toenails oohoho, the horrible toenails.

Thanks a lot Euan! That was one part of DTS/SSIS history I was hoping to put behind us. :)

Universe.Earth.Software.Microsoft.SQLServer.IS.KirkHaselden