SSIS包在Visual Studio,AND命令行中工作,但在Agent中不工作

时间:2015-02-24 06:20:43

标签: ssis odbc sage-erp

我有一个SSIS包,我使用VS在服务器上开发。 该程序包在Visual Studio中运行良好,但是当我在SQL Server代理中添加作业时,程序包将失败。 我从SAGE Line 50 v19中提取数据,因此ODBC驱动程序是32位。我在64位环境中运行。 已经将odbc设置为32位,确保代理程序设置为运行32位,但是sill遇到错误。我已经测试过从命令行运行包,如下所示

"C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\DTExec.exe" /FILE "E:\Reporting\Projects\SSIS\SSIS2012\SSIS2012\Package1.dtsx" /DECRYPT password /CHECKPOINTING OFF  /REPORTING EWCDI

当我运行它时,这很好用。但是,当我将sql代理作业设置为"操作系统(CmdExec)"我得到以下输出。

Microsoft (R) SQL Server Execute Package Utility
Version 11.0.2100.60 for 32-bit
Copyright (C) Microsoft Corporation. All rights reserved.

Started:  13:30:44
Info: 2015-02-24 13:30:44.45
   Code: 0x40016044
   Source: Data Flow Task Data Flow Task (SSIS.Pipeline)
   Description: Attempting to upgrade "ODBC Source". The package is attempting to upgrade an extensible object.
End Info
Error: 2015-02-24 13:30:44.59
   Code: 0xC0014020
   Source: SSIS002_SageCompany5Import Connection manager "Sage005.Manager"
   Description: An ODBC error -1 has occurred.
End Error
Error: 2015-02-24 13:30:44.59
   Code: 0xC0014009
   Source: SSIS002_SageCompany5Import Connection manager "Sage005.Manager"
   Description: There was an error trying to establish an Open Database Connectivity (ODBC) connection with the database server.
End Error
Error: 2015-02-24 13:30:44.59
   Code: 0xC00291EC
   Source: Get Max(SourceID) Execute SQL Task
   Description: Failed to acquire connection "Sage005.Manager". Connection may not be configured correctly or you may not have the right permissions on this connection.
End Error
Warning: 2015-02-24 13:30:44.59
   Code: 0x80019002
   Source: SSIS002_SageCompany5Import 
   Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
End Warning
DTExec: The package execution returned DTSER_FAILURE (1).

我无法理解为什么其他地方运行正常。谷歌搜索了几个小时,尝试了所有我能想到的运气,没有运气。

2 个答案:

答案 0 :(得分:0)

我正在做类似的32位DSN&我检查了SQL作业中的“32位运行时”复选框(在SSIS作业步骤 - 高级选项卡下)。

查看操作系统(CmdExec)选项,看起来有一个“/ X86”开关 - 如果你必须从命令行运行或者只是选中上面的框,可以试试吗?

如果您说代理“设置为运行32位”,那么这是您已经完成的事情。

答案 1 :(得分:0)

不是100%确定这是否适用于你,但我遇到了类似的问题,我在ssis项目中的cmd应用程序在VS中完美运行但是一旦部署到ssisdb就会挂起,并且永远不会完成结果显示cmd需要用户输入并且它在ssisdb中没有显示,所以你无法继续,它会出错

希望这有点帮助