Building a Custom Transformation from the ATL Custom Transformation Template

DTS Programming

DTS Programming

Building a Custom Transformation from the ATL Custom Transformation Template

To build a Data Transformation Services (DTS) custom transformation, use the Active Template Library (ATL) custom transformation template. This template, which enables you to build custom transformations more quickly than if you used the ATL standard template, is included in the Microsoft® SQL Server™ 2000 DTS sample programs. For more information, see DTS Programming Samples.

Installing the ATL Custom Transformation Template

To install the ATL custom transformation template, do the following:

  1. Copy all the files in the DTSXFormTemplate folder except DTSCuXFm.reg to C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Template\ATL\. This location will be different if Microsoft Visual Studio® version 6.0 was not installed to the default location.

  2. Double-click DTSCuXFm.reg to run the file.
Building a Custom Transformation Framework from the Template

You can create an ATL component that includes a custom transformation class by using the Microsoft Visual C++® development environment.

To create the ATL component

  1. On the File menu, click New, and then click the Projects tab.

  2. Click ATL COM AppWizard, and then enter a project name and location.

    For this discussion, assume DTSTrans was entered for the project name.

  3. Click Dynamic Link Library (DLL), click Finish, and in the New Project Information dialog box, click OK.

  4. On the Insert menu, click New ATL Object, click DTS Custom Objects, click DTS Transformation, and then click Next.

  5. On the Names tab, enter a short name.

    For this discussion, assume CustomXFm was entered. The wizard will fill in the other fields. The COM/Type field is the name that will appear in the Create New Transformation dialog box of DTS Designer, You can change it from the default CustomXFm Class.

  6. Click the Attributes tab, and then do the following:
    • Under Threading Model, click Both.

    • Under Interface, click Dual.

    • Under Aggregation, click No.

    • Select the Support ISupportErrorInfo check box.

The wizards will create files for the DTSTrans component and the CustomXFm class and save them to the project location folder specified in Step 1.

Building this transformation project from the Build/Build DTSTrans.dll menu, before adding any custom code, installs a custom transformation that will appear in the Create New Transformation dialog box and can be included in a DTS package. However, this custom transformation will not copy or transform the source columns when the package is run. For more information about building and debugging a custom transformation, see Implementing and Testing a DTS Custom Transformation.