A script transformation in SSIS 2016 doesn't upgrade to SSIS 2022

Igor Gelin 0 Reputation points

Hi All,

I created an SSIS 2016 ETL. The ETL has a script transformation in a data flow. Merged the ETL with the SSIS 2022 solution. Upgraded the ETL to 2022 in Visual Studio 2022.

Reviewed the upgrade report:

==========

The Upgrade is Successful

  • Upgrading package MyCoolETL.dtsx (Success) Messages
    • Information 0x4001601a: Load MyCoolETL: The MyCoolScriptTransformation has been migrated. The package must be saved to retain migration changes.

==========

Opened the ETL in the designer and got the following error message: Error loading MyCoolETL.dtsx: The component metadata for "MyCoolScriptTransformation" could not be upgraded to the newer version of the component. The PerformUpgrade method failed.

Any solution, please?

Thanks,

Igor

  1. Deepesh Dhake 165 Reputation points

    You can verify TargetServerVersion = SQL Server 2022 in the project properties and confirm your Visual Studio 2022 has the current SSIS Projects extension installed.

    If that doesn't clear it, recreate the script component: copy out your ScriptMain code, input/output column definitions, and ReadOnly/ReadWrite variable lists from the original; delete the failing transformation; add a fresh Script Component (Transformation type); reconfigure the inputs, outputs, columns, and variables to match; paste the code back; and rebuild. This is the approach that consistently resolves it because it forces SSIS to generate clean metadata at the current pipeline version instead of trying to upgrade the stale stamped version.

  2. Igor Gelin 0 Reputation points

    Hi Deepesh,

    The TargetServerVersion in the project properties is SQL Server 2022 and Visual Studio 2022 has the current SSIS Projects extension installed.

    Manually replacing a script transformation in a package is not a good option because we have many packages with many script transformations.

    Thanks,

    Igor

  3. Deepesh Dhake 165 Reputation points

    You can try this:

    1. Open the failing package, click the script component, hit Edit Script.
    2. When the VSTA editor opens, do Build then Build, then close it.
    3. Save the package and reload.

    If that clears the error, the cause is the script project's .NET target framework getting stuck on 4.0 after the upgrade.

  4. Igor Gelin 0 Reputation points

    That did not help.

  5. Lakshmi Narayana Garikapati 1,330 Reputation points β€’ Microsoft External Staff β€’ Moderator

    Hi @Igor Gelin ,

    Thank you for your detailed explanation. It looks like you've already followed the recommended steps, but the issue persists.

    To help resolve this further, I recommend raising a support ticket so our support team can assist you directly. Please refer to the following link for instructions on how to create a support ticket:

    https://support.serviceshub.microsoft.com/supportforbusiness/create

    We appreciate your engagement and thank you for being an active part of the community.

    Thanks,

    Lakshmi.


Sign in to comment

2 answers

  1. Deepesh Dhake 165 Reputation points
    1. Open the solution in Visual Studio 2022.
    2. For each package with a script component, click Edit Script to open the script project. In the script project properties, change Target Framework to 4.6 (or higher) - it's likely stuck on 4.0. Save and close.
    3. Set the package project's TargetServerVersion back down (e.g. to 2016/the original), click OK.
    4. Right-click the folder where the packages live then Upgrade All Packages, run the wizard.

    You can also refer to following link: https://learn.microsoft.com/en-us/archive/msdn-technet-forums/b0ed316a-a27c-4f94-a735-1a617129c875

    0 comments No comments

    Sign in to comment
  2. AI answer

    The error indicates that the Script Component’s metadata or binary script cannot be upgraded by the SSIS 2022 runtime, even though the package-level upgrade succeeded. The fix is to force a full recompile/migration of the script against the newer SSIS runtime and ensure no stale or version-bound references remain.

    Use the following steps:

    1. Re-open and recompile the Script Component in VS 2022
      1. In Visual Studio 2022, open the SSIS 2022 project that contains MyCoolETL.dtsx.
      2. Open the data flow that contains MyCoolScriptTransformation.
      3. Double-click the Script Component to open the Script Transformation Editor.
      4. On the Script page, click Edit Script to open VSTA.
      5. Make a trivial change in the script (for example, add or change a comment) so that the project is marked dirty.
      6. Build the script project in VSTA (Build β†’ Build). Confirm it builds successfully.
      7. Close VSTA, then click OK to close the Script Transformation Editor.
      8. Save the SSIS package so that the migrated script is persisted. The upgrade message DTS_I_SCRIPTSMIGRATED explicitly requires saving the package to retain migration changes.
    2. Check for version-bound or unsupported references
      1. In the script project (VSTA), review References.
      2. Remove any explicit references to SSIS assemblies that are version-bound to older SQL Server/SSIS versions; the upgrade process does not automatically fix such references and leaves them unchanged.
      3. If the script uses ADODB.dll or other legacy COM/interop components, replace them with ADO.NET where possible. Scripts that depend on ADODB.dll are called out as problematic during upgrades and may not run correctly on newer runtimes.
    3. Ensure the package is actually saved after migration
      • The informational message The scripts in the package were migrated. The package must be saved to retain migration changes. (HResults.DTS_I_SCRIPTSMIGRATED) means that until the package is saved, the upgraded script metadata is only in memory. Save the project/solution after successfully rebuilding the script.
    4. If the component still fails to upgrade
      1. Create a new Script Component in the same data flow (same input/output columns and variables).
      2. Copy the script code from the old component into the new one.
      3. Rebuild the script in VSTA.
      4. Remove or disable the old Script Component.
      5. Save and reopen the package to confirm it loads without the PerformUpgrade error.
    5. Align all environments on the same SSIS runtime
      • When deploying to other servers (e.g., SSIS Catalog on SQL Server 2022), ensure the SSIS runtime version matches what is targeted by the project. For script components referencing SSIS-related assemblies that bind with version, manual update of references to the new version is required; the upgrade process does not change them automatically.

    These steps force the Script Component to be recompiled and stored with metadata compatible with SSIS 2022, resolving the PerformUpgrade failure.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.
Sign in to answer

Your answer