Adding DTS ActiveX Scripts

DTS Programming

DTS Programming

Adding DTS ActiveX Scripts

Microsoft® ActiveX® scripts can be used to add functionality to Data Transformation Services (DTS) packages. Typical supported scripts are Microsoft Visual Basic® Scripting Edition (VBScript), Microsoft JScript®, PerlScript and XMLScript. The following DTS object types require or can use ActiveX scripts:

  • The Step2 object can use an ActiveX script. The script runs before the step's task executes.

  • The ActiveScriptTask object requires an ActiveX script that performs the functionality of the task.

  • The DataPumpTransformScript and DTSTransformScriptProperties2 transformations require ActiveX scripts that perform the transformations.

You assign ActiveX scripts to a property of objects that use scripts as a single text string, which can include embedded carriage return/line feed pairs. Each scripted object also has properties for the script language and the script function name. For example:

  • For the Step2 and ActiveScriptTask objects, the script text is assigned to the ActiveXScript property. The ScriptLanguage and FunctionName properties are used to specify the scripting language and function entry point.

  • For the DataPumpTransformScript transformation, the script text is assigned to the Text property. The Language and FunctionEntry properties are used for the script language and function name, respectively.

The DTSTransformScriptProperties2 object extends the functionality of DataPumpTransformScript by providing multiple transformation phases. The script specified by the Text property must have a function for each supported phase.

The following table describes the property you use to specify the entry point for each phase the DTSTransformScriptProperties2 object supports.

Phase Entry Point Property
PreSourceData PreSourceDataFunctionEntry
Transform FunctionEntry
OnTransformFailure TransformFailureFunctionEntry
OnInsertSuccess InsertSuccessFunctionEntry
OnInsertFailure InsertFailureFunctionEntry
OnBatchComplete BatchCompleteFunctionEntry
PostSourceData PostSourceDataFunctionEntry
OnPumpComplete PumpCompleteFunctionEntry

For more information about including ActiveX scripts in DTS programs, see DTS ActiveX Scripts in Visual Basic.