2010-09-01 107 views
1

我想通过SQL Server导入导出向导导出SQL语句的结果。我收到了2个错误:SQL Server导出错误

- Copying to `Query` (Error) 
Messages 
Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. 
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x00040EDA Description: "Warning: Null value is eliminated by an aggregate or other SET operation.". 
(SQL Server Import and Export Wizard) 

Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - Query" (1) returned error code 0xC0202009. The component returned a failure code when the pipeline engine called 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. 
(SQL Server Import and Export Wizard) 

执行操作工作得很好,如果我运行在SQL Server Management Studio中只是正常的SQL。

这些错误意味着如何解决这些错误,以便出口有效?如果有问题,我将导出到选择了97-2003版本的Excel。

+0

你能告诉我们SQL语句吗? – bobs 2010-09-01 20:51:42

回答

1

本文讨论导致此错误的原因和解决方案。 http://www.developmentnow.com/g/113_2006_9_0_0_828485/Warning-Null-value-is-eliminated-by-an-aggregate-or-other-SET-operation-.htm

快速回答是,你可以使用此命令在运行查询之前关闭警告:

SET ANSI_WARNINGS OFF

但是,如果这是一个SP中,它会重新编译SP每当你运行它。

+0

MSSQL在导出过程中给出错误的意义是什么,但不是在直接运行时出现错误?另外为什么停止导出的错误,这不是一个错误,可以轻松忽略?有没有办法“修复”SQL,使错误根本不会发生? – Justin808 2010-09-01 21:02:00

+0

@ Justin808:导致包失败的警告消息的问题已被报告为SSIS错误[此处](https://connect.microsoft.com/SQLServer/feedback/details/483175/failure-because-of-warning-关于无效聚合)。 – 2010-09-01 21:04:54

+0

2009年8月15日< - 很高兴看到微软是最重要的。 – Justin808 2010-09-01 21:09:46