Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSIS defaulting seconds to 00 and rounding to nearest minute when converting string to datetime

$
0
0

Hi

I have an SSIS 2008 R2 package that gets data from an intersystems cache database and inserts it into an SQL database. The cache table contains some time fields in the format hh:mm:ss and in order to get this into a datetime field in SQL 2005, I have done some transformation and conversions to it.

The problem I am getting is that the seconds is defaulting to 00 and the minutes is being rounded up/down based on what the original seconds value was.

e.g: Original time field in cache: 18:14:33

       Destination field in SQL showing: 01/01/1900 18:15:00

These are the steps I'm taking in my package:

  1. Selecting my cache data using ADO.net data source component
  2. converting the time fields to string (length 8) using Data Conversion component
  3. using Derived Column component to add 1900-01-01 (length 19) so that I can insert the time into a datetime field in SQL
  4. converting the string back into a Date type using the Data Conversion component (data type used is date [DT_Date])
  5. inserting into ADO.net destination (sql 2005 table)

I dont get any errors and the package runs fine but the only issue I have is that the seconds in the time part is defaulting to 00 and rounding up/down the minute when I need to actual seconds from the source table.

How can I get this to work so that my destination field displays '01/01/1900 18:14:33' instead of  '01/01/1900 18:15:00'?

Thanks for your help

Rob


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>