views:

26

answers:

1

I'm trying to export the results of a SQL statement via the SQL Server Import and Export Wizard. I am receiving 2 errors:

- 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)

The Executing Actions works just fine, if I run the SQL in the SQL Server management Studio it works just fine.

What do these errors mean an how can solve them so the export works? If it matters I'm exporting to Excel with the version 97-2003 selected.

+1  A: 

This article discusses the cause and solution to this error. http://www.developmentnow.com/g/113_2006_9_0_0_828485/Warning-Null-value-is-eliminated-by-an-aggregate-or-other-SET-operation-.htm

The quick-answer is that you can turn off warnings by using this command before you run your query:

SET ANSI_WARNINGS OFF

However, if it is within a SP, it will recompile the SP every time you run it.

tgolisch
Whats the point of MSSQL giving the error during export but not when you run it directly? Also why stop the export on an error thats not an error and can be easily ignored? Is there a way to "fix" the SQL so the error doesn't happen at all?
Justin808
@Justin808: The issue of a warning message causing package failure has been reported as an SSIS bug [here](https://connect.microsoft.com/SQLServer/feedback/details/483175/failure-because-of-warning-about-null-aggregation).
Joe Stefanelli
8/15/2009 <-- Glad to see Microsoft is on top of things. </sarcasm>
Justin808