Migrating Scripts to VSTA

SQL Server Setup

When you upgrade SQL Server 2005 packages to SQL Server 2008, Integration Services migrates the scripts in any Script tasks or Script components to Microsoft Visual Studio Tools for Applications (VSTA). VSTA is the scripting environment that SQL Server 2008 Integration Services (SSIS) uses. In SQL Server 2005, the scripting environment for Integration Services is Microsoft Visual Studio for Applications (VSA).

If the scripts reference interfaces or use user-defined type values, you may need to modify those scripts before you upgrade the package. Otherwise, the package will fail to upgrade or the script will fail to validate, depending on the upgrade method that you use. The following table describes the code modifications.

Task Description

Modify references to interfaces

Replace references to IDTSxxx90 interfaces with references to the corresponding IDTSxxx100 interfaces.

This task applies to Script tasks and Script components.

Modify type objects

If user-defined type values in runtime variables are not defined in the assemblies mscorlib.dll or Microsoft.SqlServer.VSTAScriptTaskPrx.dll, change the types to inherit from System.MarshalByRefObject.

This task applies only to Script tasks.

For more information about how to migrate scripts and upgrade packages, see Upgrading Integration Services Packages.

Understanding Migration Failures

When you migrate the scripts, the migration can fail because of one of the following reasons:

  • The entry point for the VSA script was renamed.
    The entry point specifies the method in the ScriptMain class in the VSTA project that the Integration Services runtime calls as the entry point into the Script task code. The ScriptMain class is the default class that the script templates generate.
  • There is no entry point or there are multiple entry points in the VSA script.
  • Assembly references could not be added.
  • The ScriptMain class was modified to inherit from other classes in addition to the ScriptObjectModelSSIS class. Microsoft .NET Framework does not support multiple inheritance.

You cannot convert a VSA script that uses Visual Basic 2005 to a VSTA script that uses Microsoft Visual C# 2008. However, you can create a new VSTA script that uses Microsoft Visual C# 2008 For more information, see Coding and Debugging the Script Task and Coding and Debugging the Script Component.

See Also

Other Resources

Extending Packages with Scripting