export-to-excel - SSIS导出到excel

我使用 SSMS 创建了一个导出到 Excel 的查询并将其保存为 DTSX 包。将此 DTSX 包导入到 BIDS 项目中,使其每小时运行一次,并导出一个带有时间戳的 excel 文件,动态名称使用表达式。当我从 BIDS 运行时,程序包成功执行并毫无问题地创建了 excel 文件。我启用了 DelayedValidation 标志。 我可以双击 DTSX 文件,运行程序包,它会毫无问题地创建 excel 文件。当我配置为 SQL 作业时,它失败并出现以下错误

非常感谢任何指导

Microsoft (R) SQL Server Execute Package Utility  Version 10.50.2500.0 for 32-bit  Copyright (C) Microsoft Corporation 2010. All rights reserved.    
    Started:  2:53:03 PM  
    Error: 2012-09-21 14:53:05.54     
    Code: 0xC0202009     
    Source: Export MyExportQuery to Excel Destination - Query [73]     
    Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E37.  End Error  
    Error: 2012-09-21 14:53:05.54     
    Code: 0xC02020E8     
    Source: Export MyExportQuery to Excel Destination - Query [73]     
    Description: Opening a rowset for "Query" failed. Check that the object exists in the database.  End Error  
    Error: 2012-09-21 14:53:05.54     
    Code: 0xC004701A     
    Source: Export MyExportQuery to Excel SSIS.Pipeline     
    Description: component "Destination - Query" (73) failed the pre-execute phase and returned error code 0xC02020E8.  End Error  
    DTExec: The package execution returned DTSER_FAILURE (1).  
    Started:  2:53:03 PM  
    Finished: 2:53:05 PM  
    Elapsed:  2.282 seconds.  The package execution failed.  The step failed.

编辑: SSIS 配置为以 32 位模式运行

最佳答案

大多数问题都是由这些情况引起的:

  • 数据源连接或文件访问问题(当运行 sql 代理的用户没有对数据库或目标文件的正确权限时)。

  • 包保护级别(pwd是敏感数据,根据保护级别有时不复制)。

  • 64 位问题(这是 XL 导出的常见问题。由于没有适用于 64 位系统的 Jet 驱动程序,因此在 64 位操作系统上运行时,您需要在 sql 作业中使用 32 位 DTEXEC 或设置“使用 32 位运行时”选项,当您创建 SSIS 作业步骤时,它位于“执行选项”选项卡上,请查看下面链接中的图像以查看它)。

32Bit runtime option image

有关此主题的信息,请查看这篇文章,其中详细介绍了 ssis 包在 BIDS 上运行但不在 SQL 作业上运行的情况。

How do I troubleshoot SSIS packages failed execution in a SQL Agent job?

希望这对你有帮助..

亲切的问候,

https://stackoverflow.com/questions/12536647/

相关文章:

python - 使用 idapython 进行线程化

artificial-intelligence - PACMAN:吃掉所有点的捷径

php - 在根域 (www) 上启动一个 php $_SESSION 并跨子域共享 session

WIX - 添加自定义对话框后退/下一步按钮有问题

calendar - 排序 ekcalendar 或 ekreminder

povray - 你如何在 POV-Ray 中将图像包裹在一个盒子周围?

python - 了解 z3 模型

websphere - 如何在WAS集群前配置一个HTTP Server?

php - "UPDATE WHERE NOT LIKE? "

php - nginx + proxy pas - 504 网关超时,1 分钟 30 秒后超时。试过