title: SQL Server Export Errors: 0xc0202009, 0xc0209029 and 0xc0047022
body: <p>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</p>
  
  <pre><code>SET ANSI_WARNINGS OFF
  </code></pre>
  
  <p>line fixed it. That line <strong>is not</strong> working this time.</p>
  
  <p><strong>EDIT:</strong>
  I've tried with the SQL <code>SELECT * FROM Table</code> and still get the error.</p>
  
  <p>The SQL is basically:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Errors:</p>
  
  <pre><code>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)
  </code></pre>