The Package ContainerWe come now to the Package container. The package is to the Integration Services user what the canvas is to the artist. It is the starting point upon which you build solutions. It's not just a container either. Most of the settings that impact the contents and execution of the package are found on the Package container. Get to know the package properties better and you'll increase your understanding of workflow in Integration Services. Packages are essentially souped-up Sequence containers. In fact, if you were to look at the code for the Package container, you'd see that the code that is run when the package executes is the same code that is run when a Sequence container executes. The difference is that packages are treated differently internally. They are considered the top-level container and represent the outermost structure of packages. They also have a lot more properties and collections of objects than do the Sequence containers. The following are collections found only on the Package container.
The first three have already been discussed in some detail, and later chapters cover these collections in even greater detail. However, the final collection, ExtendedProperties, hasn't yet been discussed. This collection is a place where clients of the package can store data and is interesting because it's the only property or collection on the package, or any other container for that matter, that the object model persists but doesn't use. The object model provides this collection so that third-party developers or object model clients can have a place to store private data related to a package and that remains with the package, but is not modified or lost when saving or loading. This is how the designer stores the layout information for a package. If you open a package created in the designer in Source View, the ExtendedProperties are visible at the very beginning of the package. There is a package variable node that looks similar to the following:
This is the substantially shortened layout portion of the package. The designer stores all the information about where the objects are located and saves it all into an XML document. The designer then stores the XML document in an ExtendedProperty. The ExtendedProperties collection isn't exposed through the designer. It's only available to object model clients. But, it's included in this discussion to help further differentiate packages from other containers and to emphasize their extended role as the outermost containers. Note In the "how products evolve" category, the node for ExtendedProperties is called PackageVariable even though the collection is called ExtendedProperties and the object is called ExtendedProperty. Originally, the collection was called PackageVariables, but people were confused by this. Some thought that PackageVariables were just variables at package scope. The node name remained PackageVariable so as not to break packages that were written before the change and Microsoft never revisited the issue to make the persisted node consistent with the name of the objects. Important Package PropertiesIn addition, several properties are unique to the package. Many of these properties are covered in detail in other chapters. However, some brief introductory discussion is in order. PackageTypeThis property should have been called WhichDesignerCreatedThisPackage, but that would have been a little long! So, it's called PackageType. It's actually a holdover property from DTS and is an enumerated value. There are six possible values as follows:
Changing these values is not advised, especially for the DBMaint types because DBMaint is a scaled-down Integration Services designer and usually fails to load packages it did not create. CreatorNameThis is the NetBIOS username of the individual who created the package. It is set when the user creates the package and Integration Services never changes it again. It's OK to change this at any time. Integration Services never uses this property. CreatorComputerNameThe is the NetBIOS computer name of the computer used to create the package. It is set when the package is created and Integration Services never changes it again. It's also OK to change this at any time. CreationDateThis is the date when the package was created. Integration Services does not use this value in any way and it can be changed at any time. MaxConcurrentExecutablesThis property has confused and confounded newby and experienced Integration Services users alike. It's a simple concept, but the name is confusing. Basically, this is the number of threads the runtime execution engine uses to execute executables. The default is four. The maximum is 128. If you set the number higher than 128, the engine automatically uses 128. If you set it to zero, the engine automatically uses four threads. Finally, if you set the value to -1, the number of threads used is the number of processors on the machine plus two. So, if there are four processors and you set MaxConcurrentExecutables to -1, the runtime execution engine uses six threads. Also, don't confuse this number with the Data Flow Task's EngineThreads property. That property is a hint to the Data Flow Task how many threads it should use. PackagePriorityClassThis is another holdover from DTS. It changes the priority the runtime engine uses for its threads. VersionMajorThis is the first of three values you can use for versioning your package. VersionMinorThis is the minor version and can be used anytime you make minor changes to the package. VersionBuildThe designer increments this value every time you build the project in which the package is found. You can change any of the version number properties at any time without a problem. Integration Services does not use these properties other than incrementing the VersionBuild value. VersionCommentsThis property can be used for any comments you might have about the current or past versions. It's provided to give you a way to document the changes to the package at certain milestones. VersionGUIDThe Integration Services runtime changes this value every time you save the package. It is read-only and should not be modified. |