[英]SQL job fails to execute package, but VS not
When I run package directly from Visual Studio then it doesn't throw error. 当我直接从Visual Studio运行程序包时,它不会引发错误。 When I execute the package via SQL Server Agent Job then it throws error: 当我通过SQL Server代理作业执行程序包时,它将引发错误:
Source: Fact_Invoice_Item PWBConsolidation [1] Description: SSIS Error Code DTS_E_OLEDBERROR. 来源:Fact_Invoice_Item PWBConsolidation [1]说明:SSIS错误代码DTS_E_OLEDBERROR。 An OLE DB error has occurred. 发生OLE DB错误。 Error code: 0x80004005. 错误代码:0x80004005。 An OLE DB record is available. OLE DB记录可用。 Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x00040EDA Description: "Warning: Null value is eliminated by an aggregate or other SET operation.". 源:“ Microsoft SQL Server本机客户端10.0”结果:0x00040EDA说明:“警告:通过聚合或其他SET操作消除了空值。 End Error Error: 2012-02-14 07:17:49.01 Code: 0xC0047038 Source: Fact_Invoice_Item SSIS.Pipeline 结束错误错误:2012-02-14 07:17:49.01代码:0xC0047038源:Fact_Invoice_Item SSIS.Pipeline
Description: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. 说明:SSIS错误代码DTS_E_PRIMEOUTPUTFAILED。 The PrimeOutput method on component "PWBConsolidation" (1) returned error code 0xC0202009. 组件“ PWBConsolidation”(1)上的PrimeOutput方法返回了错误代码0xC0202009。 The component returned a failure code when the pipeline engine called PrimeOutput(). 当管道引擎调用PrimeOutput()时,该组件返回失败代码。 The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. 故障代码的含义由组件定义,但是错误是致命的,并且管道停止执行。 There may be error messages posted before this with more information about the failure. 在此之前可能会发布错误消息,其中包含有关失败的更多信息。 End Error DTExec: The package execution returned DTSER_FAILURE (1). 结束错误DTExec:程序包执行返回DTSER_FAILURE(1)。 Started: 7:14:35 AM Finished: 7:17:50 AM Elapsed: 195.094 seconds. 开始:7:14:35 AM完成:7:17:50 AM经过:195.094秒。 The package execution failed. 程序包执行失败。 NOTE: The step was retried the requested number of times (3) without succeeding. 注意:步骤已重试要求的次数(3),但未成功。 The step failed. 该步骤失败。
I have isolated a part that is causing the problem. 我已经隔离了导致问题的零件。 In Ole Db Source I use query to get the data and when I remove the following line then the package is executed successfully via Sql Server Agent Job: 在Ole Db Source中,我使用查询来获取数据,并且当我删除以下行时,该包将通过Sql Server Agent Job成功执行:
Checksum = Checksum(S.BrokerID, S.TeamID, II.DatabaseName, II.INVOICE, I.Invoice_Date, P.Expiration_Date, P.Effective_Date,
P.Binder_Effective, I.AGENCY, II.MARKET, P.POLICY, CT.LINE_OF_BUSINESS, II.Coverage_Type, SUB.INSURED,
LOB.Description, CT.Description, I.Date_Due, I.Installment, P.Installments, P.ENDORSES, I.Inv_Tdate, Inv_Acctcur,
INS.INDUSTRY, SUB.SUBMISSION
)
EDIT: 编辑:
I have just checked and looks like part of data gets through data flow and at some point it just throws error. 我刚刚检查了一下,看起来部分数据通过了数据流,并在某个时候抛出了错误。 I have manually set Checksum=2 and still doesn't work 我已经手动设置了Checksum = 2,但仍然无法正常工作
Any idea why is this so? 知道为什么会这样吗?
Thanks a lot, 非常感谢,
Ilija 伊利亚
This looks like you are running into a constraint issue on your table that you are inserting into or values you are operating on...like aggregate function(max,sum,avg..) exists on a null value. 看起来您正在插入的表上遇到约束问题,或者您要对值进行操作...就像聚合函数(max,sum,avg ..)存在于空值上一样。
Try redirecting error rows to a flat file or something of that nature and see if you still get the error. 尝试将错误行重定向到平面文件或类似性质的文件,然后查看是否仍然收到错误。
Also try set ANSI_WARNINGS OFF in your SQL statement 也尝试在SQL语句中将ANSI_WARNINGS OFF设置为OFF
Enjoy and good luck 祝你好运
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.