Package2 Object

DTS Programming

DTS Programming

Package2 Object

The Package2 object is the parent object of a Data Transformation Services (DTS) package. Most of the new properties support logging to the msdb database of a specified instance of Microsoft® SQL Server™.

Extended Properties
ExplicitGlobalVariables Property LogServerUserName Property
FailPackageOnLogFailure Property LogToSQLServer Property
LogServerFlags Property NestedExecutionLevel Property
LogServerName Property PackageType Property
LogServerPassword Property  
Extended Methods
SaveToRepositoryAs Method SaveToStorageFileAs Method
SaveToSQLServerAs Method  

Remarks

The Package2 object extends the functionality of the existing Package object and inherits the properties and methods of that object. In addition, several extended methods and properties have been added.

The ExplicitGlobalVariables property inhibits automatic creation of global variables on first reference. The NestedExecutionLevel property helps detect uncontrolled recursive package execution through the ExecutePackageTask object. The PackageType property provides information about the package creator.

The LogToSQLServer, LogServerFlags, LogServerName, LogServerPassword, LogServerUserName, and FailPackageOnLogFailure properties enable logging to an instance of SQL Server, identify the server, and provide authentication information.

The SaveToRepositoryAs, SaveToSQLServerAs, and SaveToStorageFileAs methods assign a new name and package ID to a Package2 object, and then save it to the specified persistent storage.

Note  In SQL Server 2000, if a Package2 object variable is declared, WithEvents, event handlers should be provided for all of the Package events, and the ExecuteInMainThread property should be set to TRUE for all steps.

From within ActiveX® scripts, use DTSGlobalVariables.Parent to reference the Package2 object. From the Package2 object, you can reference any other object in the hierarchy.

For more information about when to use the Package object instead of the Package2 object, see Extended DTS Objects.

See Also

Creating DTS Package Objects and Connections

Package Object