SSIS包失败,因为"脚本任务失败,因为脚本不预编译" [英] SSIS Package failing because "script task is failing because the script is not precompiled"

查看:748
本文介绍了SSIS包失败,因为"脚本任务失败,因为脚本不预编译"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个非常简单的SSIS包(在VS2005 W / .Net框架V 2.0.50727 SP2),获取用户的电子邮件列表,启动一个for-each循环容器中,然后执行脚本任务检索用户具体数据和电子邮件将其发送给用户。当我在我的dev的盒子运行一切的伟大工程,并运行它应该。然而,当我的包部署到我们的生产服务器上运行(微软的SQL Server 2005 - 在Windows NT 5.2 9.00.5000.00(X64)标准版(64位)(建设3790:Service Pack 2的))任务失败。

原来的错误消息是:




作为用户执行:XXXXX。微软(R)的SQL Server执行包实用工具版本9.00.5000.00 64位代码:0x00000009来源:PACKAGENAME说明:该任务无法在64位环境中执行,因为脚本不预编译。请打开选项,在任务编辑器预编译脚本。结束错误...错误DTEXEC:包执行返回DTSER_FAILURE(1)




研究了大量经过interwebs建议我试试。




  1. 通过更改SQL作业的执行财产,改变从真我RunIn64BitMode属性设置为false $ b $运行于32位包b

    • 这将失败,因为选项/ X86是无效的。


  2. 安装 Microsoft修补


    • 其中,因为我已经在SP2上运行



$ b $不适b

所以更多的研究后,我发现我需要打开请打开相应的选项预编译任务编辑器的脚本。来源:SSIS-DOT DTSX Blogspot的点com / 2010/03 /无法 - 执行 - 在64位environment.html
这需要:




  • 确保每个脚本任务都有预编译= TRUE

  • 开启脚本任务编辑器,切换到脚本选项卡,并确保
    PrecompileScriptIntoBinaryCode = TRUE

  • 单击在设计脚本打开代码编辑器(Visual Studio中的应用程序),然后使用文件>关闭选择并返回(VSA将重新编译并存储在包二进制代码)。

  • 生成项目,并复制到目标位置



然而,当我执行包我立刻得到错误:




作为用户执行:XXXX。 ... 0.5000.00为64位代码:0x00000008源:PACKAGENAME描述:任务配置为预编译脚本,但二进制代码是找不到的。通过单击设计脚本按钮,导致生成二进制代码,请访问在脚本任务编辑器的IDE。结束错误代码:0x00000008来源:GET PO Infor和电子邮件说明:脚本无法重新编译或运行:用CLSID ...



检索COM类工厂组件

所以我的最后一步是从假转DelayValidation属性为True在SSIS PKG,进入设计脚本,以使其重建,然后重新部署,并重新运行,我仍然得到同样的错误。



在搜索我针对的这表明,我下载另一个修复微软热修复



我还没有下载修补程序,并会不喜欢,如果我能避免它(我们的运营团队犯规喜欢跑步修补程序中旬的一天在生产服务器上)。


解决方案

进入包,打开脚本组件,然后在Visual Studio中(而看代码)点击BUILD。这将编译该程序包,如果没有问题,防止其进行编译。然后保存,回去确保你点击好,而不是取消,如果你点击取消,那么整个事情将恢复。


I developed a pretty straight forward SSIS package (in VS2005 w/ .Net Framework V 2.0.50727 SP2) that gets a list of users to email, starts a for-each loop container and then executes a script task to retrieve user specific data and email it out to the user. When I run it on my dev box everything works great and runs as it should. However when I deploy the package to our production server running (Microsoft SQL Server 2005 - 9.00.5000.00 (X64) Standard Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2) ) the task fails.

The original error message is:

Executed as user: xxxxx. Microsoft (R) SQL Server Execute Package Utility Version 9.00.5000.00 for 64-bit Code: 0x00000009 Source: PackageName Description: The task cannot execute in 64-bit environment because the script is not pre-compiled. Please turn on the option to pre-compile the script in the task editor. End Error ... Error DTExec: The package execution returned DTSER_FAILURE (1).

After researching that extensively the interwebs suggested that I try:

  1. running the package in 32bit by changing the execution property in the SQL job and by changing my RunIn64BitMode property from true to false
    • which fails because " Option "/X86" is not valid."
  2. install the Microsoft Hotfix
    • which doesn't apply since I am already running on SP2

So after more research I find that I need to turn on "Please turn on the option to pre-compile the script in the task editor." SOURCE: ssis-dtsx DOT blogspot DOT com/2010/03/cannot-execute-in-64-bit-environment.html Which entails:

  • Make sure that each script task has PreCompile = True
  • Open Script Task Editor, switch to Script tab and make sure that PrecompileScriptIntoBinaryCode = True
  • Click on Design Script to open code editor (Visual Studio for Applications) and then choose it using File > Close and Return (VSA will recompile and store binary code in the package).
  • Build Project and copy to target location

However when I execute the package I immediately get the error:

Executed as user: xxxx. ...0.5000.00 for 64-bit Code: 0x00000008 Source: PackageName Description: The task is configured to pre-compile the script, but binary code is not found. Please visit the IDE in Script Task Editor by clicking Design Script button to cause binary code to be generated. End Error Code: 0x00000008 Source: GET PO infor and Email Description: Script could not be recompiled or run: Retrieving the COM class factory for component with CLSID...

So my final step was to turn DelayValidation property from False to True in the SSIS pkg, go into the design script to cause it to be rebuilt, then redeploy, and rerun and I still get the same error.

On searching the error I am directed to Microsoft HOT FIX which suggested that I download another hotfix.

I have not yet downloaded the hotfix, and would prefer not to if I can avoid it (our OPs team doesnt like running hotfixes mid day on production servers).

解决方案

Go to the package, open the script component, then within Visual Studio (while looking at the code) click on BUILD. This will compile the package, if there are no issues preventing it from compiling. Then SAVE, go back and ensure that you click on "OKAY" and not "cancel", if you click on cancel then the whole thing reverts back.

这篇关于SSIS包失败,因为"脚本任务失败,因为脚本不预编译"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆