Sunday, February 19, 2012

Execute Package Task in a loop works, but...

Okay, can someone explain why when I execute children packages within a loop that only a couple of them work?

When I first started this I had Child Package 1 and Child Packge 2 working from the Parent Package 1. It would loop through twice (I had 2 organizations in my outer loop) and pass in the Parent Package variables correctly.

I am using a simple "Foreach Item Enumerator" with a collection of string enumerators that are the Names of the children packages - these are assigned to a variable that is scoped to the outer loop.

Now, when I add a new Child Package 3 and set it up the same as the other 2, when it goes to execute Child Package 3 it fails with the error:

"Error: The connection manager "[My Package Name].dtsx" is not found. A component failed to find the connection manager in the Connections collection. "

What in the world have I done? I was under the assumption that since the first 2 packages worked, that any other packages I added would work the same.

I answered my own quesiton on this..

It seems as though when I created the first 2 children packages, I also created the "File" connection for them.

YOU MUST create the "File Connection" for each child SSIS Package you plan to execute.

If anyone knows different, please let me know.

|||

ronemac wrote:

I answered my own quesiton on this..

It seems as though when I created the first 2 children packages, I also created the "File" connection for them.

YOU MUST create the "File Connection" for each child SSIS Package you plan to execute.

If anyone knows different, please let me know.

Wrong I think. You only need one connection manager and you should use expressions to dynamically change the ConnectionString property of that connection manager on each loop iteration.

Regards

-Jamie

No comments:

Post a Comment