简体   繁体   English

SSIS C# 脚本不兼容

[英]SSIS C# script is not compatible

I've recently taken over a SSIS ETL based process and due to some licencing issues I had to upgraded from Data Tools 2013 to 2015. Most of the project survived the upgrade and runs well.我最近接管了一个基于 SSIS ETL 的过程,由于一些许可问题,我不得不从 Data Tools 2013 升级到 2015。大部分项目在升级后幸存下来并且运行良好。 However, in two packages I have a very simple C# method (Script Transformation) to parse some of the data which causes some issue.但是,在两个包中,我有一个非常简单的 C# 方法(脚本转换)来解析一些导致一些问题的数据。

Currently the deployment is completed by using "build" (not the newer development method via the SSIS catalog) and the SQL SERVER Job's step points directly to dtsx file.目前,部署是通过使用“构建”(不是通过 SSIS 目录的较新的开发方法)完成的,并且 SQL SERVER 作业的步骤直接指向 dtsx 文件。

The job was created in a SQL SERVER 2014 which schedule the ETL in steps.该作业是在 SQL SERVER 2014 中创建的,它按步骤安排 ETL。 The server has a 64 bits configuration.服务器具有 64 位配置。

I have tried to change the SSIS project property "Run64BitRuntime" to False and force the failing step to use 32 Bit runtime.我试图将 SSIS 项目属性“Run64BitRuntime”更改为 False 并强制失败的步骤使用 32 位运行时。 In addition, I also tried to re-create the component with the same configuration but both did not work.此外,我还尝试重新创建具有相同配置的组件,但都不起作用。

The odd part is that when I run the package from SSIS it finishes successfully but the job crushes and throw the following error message:奇怪的是,当我从 SSIS 运行包时,它成功完成,但工作崩溃并抛出以下错误消息:

*"decode" is the name of transformation script component *"decode" 是转换脚本组件的名称

Message ... Started: 11:32:30 PM Error: 2015-12-12 23:32:31.26 Code: 0xC0047062 Source: stg stg (decode [2]) Description: Microsoft.SqlServer.Dts.Pipeline.ComponentVersionMismatchException: The version of decode is not compatible with this version of the DataFlow.消息 ... 开始:11:32:30 PM 错误:2015-12-12 23:32:31.26 代码:0xC0047062 来源:stg stg(解码 [2]) 描述:Microsoft.SqlServer.Dts.Pipeline.ComponentVersionMismatchException:解码版本与此版本的 DataFlow 不兼容。 [[The version or pipeline version or both for the specified component is higher than the current version. [[指定组件的版本或管道版本或两者都高于当前版本。 This package was probably created on a new version of DTS or the component than is installed on the current PC.]] at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostCheckAndPerformUpgrade(IDTSManagedComponentWrapper100 wrapper, Int32 lPipelineVersion) End Error Error: 2015-12-12 23:32:31.26 Code: 0xC004801F Source: stg stg (SSIS.Pipeline) Description: The component metadata for "decode" could not be upgraded to the newer version of the component.此包可能是在新版本的 DTS 上创建的,或者是在当前 PC 上安装的组件之外创建的。]] 在 Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostCheckAndPerformUpgrade(IDTSManagedComponentWrapper100 wrapper, Int32 lPipelineVersion) End Error Error: 2015-12 -12 23:32:31.26 代码:0xC004801F 来源:stg stg (SSIS.Pipeline) 描述:“解码”的组件元数据无法升级到较新版本的组件。 The PerformUpgrade method failed. PerformUpgrade 方法失败。 End Error Error: 2015-12-12 23:32:31.28 Code: 0xC004801F Source: stg SSIS.Pipeline Description: The component metadata for "decode, clsid {33D831DE-5DCF-48F0-B431-4D327B9E785D}" could not be upgraded to the newer version of the component.结束错误错误:2015-12-12 23:32:31.28 代码:0xC004801F 来源:stg SSIS.Pipeline 描述:“decode, clsid {33D831DE-5DCF-48F0-B431-4D327B9E785}”的组件元数据无法升级组件的较新版本。 The PerformUpgrade method failed. PerformUpgrade 方法失败。 End Error Error: 2015-12-12 23:32:31.28 Code: 0xC0048021 Source: stg decode [2] Description: The component is missing, not registered, not upgradeable, or missing required interfaces.结束错误 错误:2015-12-12 23:32:31.28 代码:0xC0048021 来源:stg decode [2] 说明:组件缺失、未注册、不可升级或缺少所需接口。 The contact information for this component is "Includes and runs custom script code. For example, apply a business rule that limits the range of valid values in an "income" column or add values in two columns and calculate the average of the sum.;Microsoft Corporation; Microsoft SQL Server; Microsoft Corporation; All Rights Reserved; http://www.microsoft.com/sql/support;9 ".此组件的联系信息为“包含并运行自定义脚本代码。例如,应用限制“收入”列中有效值范围的业务规则或将两列中的值相加并计算总和的平均值。; Microsoft Corporation;Microsoft SQL Server;Microsoft Corporation;保留所有权利; http://www.microsoft.com/sql/support ;9”。 End Error Error: 2015-12-12 23:32:31.28 Code: 0xC0047017 Source: stg SSIS.Pipeline Description: decode failed validation and returned error code 0xC0048021.结束错误错误:2015-12-12 23:32:31.28 代码:0xC0047017 来源:stg SSIS.Pipeline 描述:解码验证失败并返回错误代码 0xC0048021。 End Error Error: 2015-12-12 23:32:31.28 Code: 0xC004700C Source: stg SSIS.Pipeline Description: One or more component failed validation.结束错误 错误:2015-12-12 23:32:31.28 代码:0xC004700C 来源:stg SSIS.Pipeline 描述:一个或多个组件验证失败。 End Error Error: 2015-12-12 23:32:31.28 Code: 0xC0024107 Source: stg Description: There were errors during task validation....结束错误错误:2015-12-12 23:32:31.28 代码:0xC0024107 来源:stg 描述:任务验证过程中出现错误....

I had faced the same problem "Error Code: 0xC0048021 " and solved it.我遇到了同样的问题“错误代码: 0xC0048021 ”并解决了它。

I installed this version of SSDT from here https://msdn.microsoft.com/en-us/mt429383我从这里安装了这个版本的 SSDT https://msdn.microsoft.com/en-us/mt429383

Then, in the SSDT solution explorer right click the Project,go to the Properties --> Configuration Properties --> TargetServerVersion = SQL SERVER 2014然后,在 SSDT 解决方案资源管理器中右键单击项目,转到属性 --> 配置属性 --> TargetServerVersion = SQL SERVER 2014

Then, in the SSDT solution explorer right click the Project, go to the Properties --> Configuration Properties --> Debugging --> Run64BitRuntime = False然后,在 SSDT 解决方案资源管理器中右键单击项目,转到属性 --> 配置属性 --> 调试 --> Run64BitRuntime = False

Referring to What's New for SSIS 2016 RC0?参考SSIS 2016 RC0 的新增功能? 选择了 SQL Server 2014 的 TargetServerVersion 选项

In my case changing SSIS packages to 32/64 bits, and setting target SQL version have not worked.在我的情况下,将 SSIS 包更改为 32/64 位,并设置目标 SQL 版本不起作用。

If you have this issue even if you set SQL Target Version to 2016, make sure that you are using correct version of SQL Server Deployment Wizard.如果即使将 SQL 目标版本设置为 2016 也遇到此问题,请确保使用正确版本的 SQL Server 部署向导。 If you are trying to deploy package on SQL2016, make sure that you have ISDeploymentWizard:如果您尝试在 SQL2016 上部署包,请确保您有 ISDeploymentWizard:

C:\\Program Files (x86)\\Microsoft SQL Server\\130\\DTS\\Binn Server\\130\\DTS\\Binn\\ISDeploymentWizard.exe C:\\Program Files (x86)\\Microsoft SQL Server\\130\\DTS\\Binn Server\\130\\DTS\\Binn\\ISDeploymentWizard.exe

If not, you have to install SSMS dedicated for SQL Server 2016 ( download link ) which will install ISDeploymentWizard.如果没有,您必须安装专用于 SQL Server 2016 的 SSMS( 下载链接),它将安装 ISDeploymentWizard。 Backward compatiliby in higher version of SSMS will not install ISDeploymentWizard.向后兼容更高版本的 SSMS 将不会安装 ISDeploymentWizard。

Probably ISDeploymentWizard for higher versions upgrades SSIS package to higher version, and SQL Server cannot downgrade it.可能是更高版本的 ISDeploymentWizard 将 SSIS 包升级到更高版本,而 SQL Server 无法将其降级。

I tried to update the only elelment which I haven't touched - SQL Server 2014, but with no impact.我试图更新我没有接触过的唯一元素 - SQL Server 2014,但没有影响。 Eventually I decided to take full ownership of process and worked around it by pushing down the logic to the database.最终我决定完全拥有流程并通过将逻辑下推到数据库来解决它。

如果您更改了项目的目标服务器版本,如其他答案中所述,请确保检查您是否已针对您正在部署的适用配置(开发、测试、生产)进行了更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM