SSIS System.TimeSpan to MSSQL Field time(7)
<p>Having a VERY VERY annoying issue with a Slowly Changing Dimension task in SSIS.</p>

<p>This data flow task starts with a Script Component that is a Source that grabs data from a web API.</p>

<blockquote>
  <p>Script Task Data Source</p>
</blockquote>

<p>In this data there is a <em>Time field</em> which comes into the Script as a string <strong>"14:21"</strong> for instance. </p>

<p>I have a piece of code that does a convert from string to timespan <code>ConvertStringToTime("14:21");</code> </p>

<p>which works fine, changing the value to a <code>System.TimeSpan</code> format <strong>"14:21:00"</strong>.</p>

<blockquote>
  <p>Script Task Data Source Output</p>
</blockquote>

<p>The value is then written to an output field with a data type of <strong>database time [DT_DBTIME]</strong> <em>(Running a data view here shows the data is all correct and looks good)</em></p>

<blockquote>
  <p>The Conversion</p>
</blockquote>

<p>I have now recently to attempt to fix this issue added in a Conversion task that takes this value and converts it to a <strong>database time stamp [DT_DBTIMESTAMP]</strong></p>

<blockquote>
  <p>Slowly Changing Dimension (SCD) - <strong>The Issue</strong></p>
</blockquote>

<p>Now this is where the issue start, I pass this row to my (SCD) and map it to a field in my MSSQL database that has a <strong>time(7)</strong> data type.</p>

<p>I receive the following error from the SCD GUI while using the converted and unconverted data fields:</p>

<p><strong>Column 1 is of type 'System.DateTime' and column 2 is of type
 'System.Object'.</strong></p>

<p>Can anyone shed some light on what is going on here?</p>