Extended DTS Objects

DTS Programming

DTS Programming

Extended DTS Objects

Several Data Transformation Services (DTS) objects that enhance objects from Microsoft® SQL Server™ version 7.0 have been added to Microsoft SQL Server 2000. These have been named by appending a 2 to the name of the existing object. For example, the DataPumpTask2 object enhances the DataPumpTask object through the addition of the RowsComplete and RowsInError properties. In this section, DataPumpTask2 refers to both the extended and original object.

Each extended object extends the functionality of the SQL Server 7.0 object and inherits the properties and methods of that object. However, none is compatible with SQL Server 7.0 or earlier. The SQL Server 7.0 objects still are available and should be used where interoperability with earlier versions of SQL Server is required.

Using the Extended Objects

When you run a DTS application that includes an extended object on SQL Server 7.0, a "type mismatch" or similar error will occur. Therefore, if you want a DTS application to run on both an instance of SQL Server 2000 and SQL Server 7.0, it is recommended that you do not use the extended objects.

A potential for failure under SQL Server 7.0 exists even when the extended objects are not used. If you run a DTS application on SQL Server 2000, you can access the new properties of the extended objects through the Properties collection of the existing objects. For example, you can access the LogServerName property through the Properties collection of the Package object, even though LogServerName is new for Package2.

The following Microsoft Visual Basic® code shows how you can access the new LogServerName property through the Properties collection of the Package object:

Dim objPackage      As DTS.Package
Set objPackage = New DTS.Package
objPackage.Properties("LogServerName") = "(local)"

This code works when run on an instance of SQL Server 2000. However, if you run the application on SQL Server 7.0, the same code will fail with an error message similar to "property 'LogServerName' was not found."