title: SSIS: data types just don't get converted from string
body: <p>That's my first experience in SSIS and I'm just going nuts: <em>NOTHING WORKS</em>.<br />
  (Don't be afraid of big post: most is just errors output.)</p>
  <p>I've got two MS SQL DBs with same fields and I have to transfer from first one, where everything is in nvarchar(32) aka DT_WSTR, into second one, where types are different.</p>
  <p>Data and its examples:<br />
  &quot;<em>Timestamp</em>&quot; is &quot;datetime2(7)&quot; in destination, and source looks like ISO 8601: 2013-12-19T00:00:00.000<br />
  &quot;<em>Value</em>&quot; is &quot;real&quot; numbers with scientific notation, test examples are: 17e+10, 17.14, 17.14e+5, 1715E+4, 1714<br />
  And four columns with just different ints (bigint, bigint, tinyint, int).</p>
  <p>Now for what I've tried (warning for lots of quotations):</p>
  <ul>
  <li>Derived Column. I used casts like &quot;(DT_DBTIMESTAMP2,7)time&quot; and &quot;(DT_R4)value&quot;. Perhaps I'm using wrong types, but I strongly doubt: I googled it like a lot and most articles (like <a href="http://www.bidn.com/blogs/DevinKnight/ssis/1387/ssis-to-sql-server-data-type-translations" rel="nofollow noreferrer">this</a>) tells that I'm right.</li>
  </ul>
  <blockquote>
  <p>Error: 0xC0049064 at Import from ODS to DWH, Derived Column [2]: An error occurred while attempting to perform a type cast.</p>
  <p>Error: 0xC0209029 at Import from ODS to DWH, Derived Column [2]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The &quot;Derived Column&quot; failed because error code 0xC0049064 occurred, and the error row disposition on &quot;Derived Column.Outputs[Derived Column Output].Columns[timestamp]&quot; 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.</p>
  <p>Error: 0xC0047022 at Import from ODS to DWH, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component &quot;Derived Column&quot; (2) failed with error code 0xC0209029 while processing input &quot;Derived Column Input&quot; (3). 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.
  Error: 0xC02020C4 at Import from ODS to DWH, OLE DB Source [62]: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.</p>
  <p>Error: 0xC0047038 at Import from ODS to DWH, SSIS.Pipeline: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on OLE DB Source returned error code 0xC02020C4.  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.</p>
  </blockquote>
  <ul>
  <li>Explicitly changing types in source (so they match destination) and connecting directly to destination.</li>
  </ul>
  <blockquote>
  <p>Error: 0xC020901C at Direct, OLE DB Source [32]: There was an error with OLE DB Source.Outputs[OLE DB Source Output].Columns[time] on OLE DB Source.Outputs[OLE DB Source Output]. The column status returned was: &quot;The value could not be converted because of a potential loss of data.&quot;.</p>
  <p>Error: 0xC0209029 at Direct, OLE DB Source [32]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The &quot;OLE DB Source.Outputs[OLE DB Source Output].Columns[time]&quot; failed because error code 0xC0209072 occurred, and the error row disposition on &quot;OLE DB Source.Outputs[OLE DB Source Output].Columns[time]&quot; 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.</p>
  <p>Error: 0xC0047038 at Direct, SSIS.Pipeline: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on OLE DB Source returned error code 0xC0209029.  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.</p>
  </blockquote>
  <ul>
  <li>Data Conversion. Same result: failure.</li>
  </ul>
  <blockquote>
  <p>Error: 0xC02020C5 at Conversion, Data Conversion [2]: Data conversion failed while converting column &quot;time&quot; (74) to column &quot;Copy of time&quot; (11).  The conversion returned status value 2 and status text &quot;The value could not be converted because of a potential loss of data.&quot;.</p>
  <p>Error: 0xC0209029 at Conversion, Data Conversion [2]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The &quot;Data Conversion.Outputs[Data Conversion Output].Columns[Copy of time]&quot; failed because error code 0xC020907F occurred, and the error row disposition on &quot;Data Conversion.Outputs[Data Conversion Output].Columns[Copy of time]&quot; 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.</p>
  <p>Error: 0xC0047022 at Conversion, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component &quot;Data Conversion&quot; (2) failed with error code 0xC0209029 while processing input &quot;Data Conversion Input&quot; (3). 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.</p>
  <p>Error: 0xC02020C4 at Conversion, OLE DB Source [62]: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.</p>
  <p>Error: 0xC0047038 at Conversion, SSIS.Pipeline: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on OLE DB Source returned error code 0xC02020C4.  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.</p>
  </blockquote>
  <p>So now I just ran out of tools and ideas how to do this: most instructions just say something like &quot;map this to that and it will work&quot;. I'm struggling with this so hard and for so long I even created a StackExchange account for that. Any help appreciated. Cheers.</p>