You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SSIS中Microsoft.ScriptTask通过Dtexec/SQL Server执行失败问题

SSIS ScriptTask执行失败问题求助

我的SSIS项目只要包含Microsoft.ScriptTask,无论任务内容是否为空,都会触发异常报错。所有脚本在Visual Studio中运行正常,但通过Dtexec或SQL Server执行时失败。

已尝试的解决方案

  • 确认使用正确版本的DTExec(150版本,对应SQL Server 2019)
  • 检查包版本与SQL Server版本一致(均为2019版本15)、验证解决方案加密类型
  • 重新安装SSDT
  • 以管理员身份运行DTExec所在CMD及Visual Studio 2019
  • 重建Script Task
  • 确认DTExec为64位版本
  • 通过SSMS的Agent Profiler运行包仍报错
  • 确认电脑.Net Framework版本与包目标版本一致(均为4.8)

执行命令及错误日志

"C:\Program Files\Microsoft SQL Server\150\DTS\Binn\Dtexec.exe" /f "C:\Directory\Documents\SSIS Tests\TEST_PROJECT\Package.dtsx"
Microsoft (R) SQL Server Execute Package Utility
Version 15.0.2000.5 for 64-bit
Copyright (C) 2019 Microsoft. All rights reserved.

Started:  16:35:16
Error: 2022-10-20 16:35:17.17
   Code: 0xC001F02A
   Source: Sequence Container
   Description: Cannot create a task from XML for task "Script Task", type "Microsoft.ScriptTask" due to error 0x80070057 "The parameter is incorrect.".
End Error
Error: 2022-10-20 16:35:17.17
   Code: 0xC0010018
   Source: Script Task
   Description: Failed to load task "Script Task", type "". The contact information for this task is "".
End Error
Error: 2022-10-20 16:35:17.18
   Code: 0xC0010026
   Source: Script Task
   Description: The task has failed to load. The contact information for this task is "".
End Error
Error: 2022-10-20 16:35:17.18
   Code: 0xC0024107
   Source: Script Task
   Description: There were errors during task validation.
End Error
Error: 2022-10-20 16:35:17.18
   Code: 0xC0010025
   Source: Package
   Description: The package cannot execute because it contains tasks that failed to load.
End Error

可能的解决方向

  • 检查Script Task程序集注册:运行regsvr32 "C:\Program Files\Microsoft SQL Server\150\DTS\Tasks\Microsoft.SqlServer.ScriptTask.dll"(64位系统),确认注册成功;若为32位环境,使用C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Tasks路径下的文件
  • 验证SSIS服务账户权限:确保SQL Server Integration Services服务的运行账户拥有Script Task相关程序集的读取权限,以及包所在目录的读写权限
  • 检查包XML结构:手动打开.dtsx文件,查看Script Task节点的Type属性是否为Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptTask, Microsoft.SqlServer.ScriptTask, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91,确认XML无语法错误或无效参数
  • 排查环境依赖冲突:尝试在全新的SQL Server 2019测试环境部署包,排除当前环境的组件冲突问题
  • 查看系统事件日志:在Windows事件查看器中检索SSIS相关错误日志,获取程序集加载失败的具体详情
  • 重新安装SSIS组件:卸载并重新安装SQL Server 2019的Integration Services功能,确保脚本任务组件完整安装

内容的提问来源于stack exchange,提问作者Mitchell Mastromonaco

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.15 20:01:02