Passing parameter to a dts

I don't understand how to pass a parameter to a dts package from another. In SQL 2000 you can map a variable with a variable of the package you will call.

How can I do this?
For example in the current package execution (package1) I have a variable1 = 5 and when some step complete I call package2 with the value of variable1 in variable2 of package2.

I need help with this.

Thanks in advance.

[403 byte] By [VectorR3] at [2008-2-21]
# 1
A Parent package configuration will do the job. You can also directly reference variables in a parent package from within a script task of the child package.

Some more info here: http://blogs.conchango.com/jamiethomson/archive/2005/03/17/1151.aspx

-Jamie

JamieThomson at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 2
Yes I try to do this with no luck. I don't know how to reference to the parent PackageName.

I put System:PackageName and I get the warning Configuration from a parent variable "System:PackageName" did not occur because there was no parent variable. Error code: 0xC0010001.

SSIS package "INSA_Dim_Vendedor.dtsx" finished: Failure.
And I have to say something. I my thought a package is like an object. It have to talk with others by messages. If you do with configuration is the oposite of OOP.

Why a package should know which parent variable have to read? It have no sense.

The new DTSs doesn't have the concept of interface? If you want to run that package pass it these parameters. But know you have to call parent variables with the same name instead of calling a package with some values.

VectorR3 at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 3
VectorR3 wrote:
Yes I try to do this with no luck. I don't know how to reference to the parent PackageName.
I put System:PackageName and I get the warning Configuration from a parent variable "System:PackageName" did not occur because there was no parent variable. Error code: 0xC0010001.
SSIS package "INSA_Dim_Vendedor.dtsx" finished: Failure.

And I have to say something. I my thought a package is like an object. It have to talk with others by messages. If you do with configuration is the oposite of OOP.
Why a package should know which parent variable have to read? It have no sense.
The new DTSs doesn't have the concept of interface? If you want to run that package pass it these parameters. But know you have to call parent variables with the same name instead of calling a package with some values.

You missed a colon, its "System::PackageName"

I see your point about passing values however think of it in these terms. The parent package configuration IS the interface, you can still pass it whatever values you want to. Admittedly this means you have to put them into the appropriate variable and this is your bug bear about it and quite honestly, I see your point.

I don't think it helps to think of SSIS in OOP terms however. This is a different paradigm and different rules apply.

However, you can still pass arbitrary values into a package without the package knowing that it is going to receive them using command-line parameters. In fact, this is even better than what you are proposing because the child package doesn't even have to provide a recognised interface. The only problem is that you can't do it via the execute package task. It would be nice if they provided a GUI to do it just as is provided with parent package configurations. This explains how to do it: http://blogs.conchango.com/jamiethomson/archive/2004/12/13/451.aspx

-Jamie

JamieThomson at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 4
You can just reference the variable in the child package as well. The child package won't run successfully if it's run independently, but if it always runs as a child, then just reference the variable in the parent.
KirkHaselden at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 5
KirkHaselden wrote:
You can just reference the variable in the child package as well. The child package won't run successfully if it's run independently, but if it always runs as a child, then just reference the variable in the parent.

Hmmm...not entirely true I don't think. The only way I can find to do this is using the Script Task - if thre are other tasks/components that enable you to do it then I haven't found them.
e.g. Execute SQL Task cannot reference vars in a parent, neither can the rowcount transformation.

-Jamie

JamieThomson at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 6
Ah, no, not during design time. But, during execution time, yes. Tasks that attempt to validate with a reference to the variable will fail of course because they have not been given the parent's collection of variables. Try it with delay validation... :)
KirkHaselden at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...

SQL Server

Site Classified