views:

211

answers:

1

I'm trying to export some information from SQL Server. The SQL runs fine in the SQL Management Studio, but when I try to export it gives me the following errors. I've had issues similar to this before and adding the

SET ANSI_WARNINGS OFF

line fixed it. That line is not working this time.

EDIT: I've tried with the SQL SELECT * FROM Table and still get the error.

The SQL is basically:

SELECT [Table]
      , CASE WHEN [UserID] IS NULL THEN '' ELSE [UserID] END AS [UserID]
      , CASE WHEN [fieldname] IS NULL THEN '' ELSE [fieldname] END AS [fieldname]
      , CASE WHEN [fieldname] IS NULL THEN '' ELSE [fieldname] END AS [fieldname]
      , CASE WHEN [fieldname] IS NULL THEN '' ELSE [fieldname] END AS [fieldname]
                             ... more ...
      , CASE WHEN [fieldname] IS NULL THEN '' ELSE [fieldname] END AS [fieldname]
      CASE WHEN [fieldname] IS NULL THEN '' ELSE [fieldname] END AS [fieldname]
  FROM Table

Errors:

Messages
Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x00040EDA.
 (SQL Server Import and Export Wizard)

Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "input "Destination Input" (174)" failed because error code 0xC020907B occurred, and the error row disposition on "input "Destination Input" (174)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
 (SQL Server Import and Export Wizard)

Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Destination - Query" (163) failed with error code 0xC0209029 while processing input "Destination Input" (174). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.
 (SQL Server Import and Export Wizard)
A: 

I'm chalking this up to Microsoft being an idiot.

I have some fields that are dates. The dates all work just fine for the export with the exception of on date from 1790. If i convert all dates older than 1800 to blank, the export works just fine.

How any of those errors relates to the issue, you got me.

Way to go M$

Justin808
SQL Server's `DATETIME` data type has a known and documented limitation on its range and cannot deal with dates before 1753-01-01. The new `DATE` or `DATETIME2` data types in SQL Server 2008 and newer do not have that restriction anymore.
marc_s
I know of the SQL limitation, the export was to an excel file. I'm guessing there is a more limited limitation there.
Justin808