Chapter 46

Configuring Child Packages

After creating many packages in your environment, you can see that some common pieces of work are done in multiple packages. You can extract these common functions and place them in separate packages that can be shared more easily. In a data warehouse environment, dimensions are processed before fact loads. In this case, you want packages to be executed in a particular order. The use of child packages can simplify both cases. A child package is a package executed from another package. The package that executes another package is called a parent package. The parent package calls the child package by using the Execute Package Task in the Control Flow.

The Execute Package Task can be placed anywhere in the Control Flow of a parent package just like any of the tasks in the Toolbox. You can use expressions and precedence constraints to decide if the Execute Package Task runs in the parent package, enabling you to control when and if the child package executes. The child package does not have to be the last task in the parent package.

When the child package completes, it reports its success or failure status to the Execute Package Task in the parent package. Other tasks can follow the Execute Package Task, linked by precedence constraints. The setting of the precedence constraint, compared to the child package status, determines whether or not the following tasks will run. This operates like any other task using a precedence constraint. When a child ...

Get Knight's Microsoft SQL Server 2012 Integration Services 24-Hour Trainer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.