Extending the Data Flow with the Script Component

APPLIES TO: yesSQL Server, including on Linux yesAzure SQL Database yesAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

The Script component extends the data flow capabilities of Microsoft Integration Services packages with custom code written in Microsoft Visual Basic or Microsoft Visual C# that is compiled and executed at package run time. The Script component simplifies the development of a custom data flow source, transformation, or destination when the sources, transformations, and destinations included with Integration Services do not fully satisfy your requirements. After you configure the component with the expected inputs and outputs, it writes all the required infrastructure code for you, letting you focus exclusively on the code that is required for your custom processing.

A Script component interacts with the containing package and with the data flow through the autogenerated classes in the ComponentWrapper and BufferWrapper project items, which are instances of the ScriptComponent and the ScriptBuffer classes respectively. These classes make connections, variables, and other package items available as typed objects, and manage inputs and outputs. The Script component can also use the Visual Basic namespace and the .NET Framework class library, as well as custom assemblies, to implement custom functionality.

The Script component and the infrastructure code that it generates for you simplify significantly the process of developing a custom data flow component. However, to understand how the Script component works, you may find it useful to read the section Developing a Custom Data Flow Component to understand the steps that are involved in developing a custom data flow component.

If you are creating a source, transformation, or destination that you plan to reuse in multiple packages, you should consider developing a custom component instead of using the Script component. For more information, see Developing a Custom Data Flow Component.

In This Section

The following topics provide more information about the Script component.

Configuring the Script Component in the Script Component Editor
Properties that you configure in the Script Transformation Editor affect the capabilities and the performance of Script component code.

Coding and Debugging the Script Component
You use the Microsoft Visual Studio Tools for Applications (VSTA) development environment to develop the scripts contained in the Script component.

Understanding the Script Component Object Model
A new Script component project contains three project items with several classes and autogenerated properties and methods.

Using Variables in the Script Component
The ComponentWrapper project item contains strongly-typed accessor properties for package variables.

Connecting to Data Sources in the Script Component
The ComponentWrapper project item also contains strongly-typed accessor properties for connections defined in the package.

Raising Events in the Script Component
You can raise events to provide notification of problems and errors.

Logging in the Script Component
You can log information to log providers enabled on the package.

Developing Specific Types of Script Components
These simple examples explain and demonstrate how to use the Script component to develop data flow sources, transformations, and destinations.

Additional Script Component Examples
These simple examples explain and demonstrate a few possible uses for the Script component.

See Also

Script Component
Comparing the Script Task and the Script Component