I have a column of DT_DBTIME data type in my Flat File source. This column is mapped to DateTime column in the SQL server destination table. A problem is that time values '12:06:39' and '13:37:45' are converted to the dates '12/30/1899 12:06:39 PM' and '12/30/1899 1:37:45 PM' correspondingly.
When I try the similar conversion from the inside Server Management Studio :
SELECT CAST('12:06:39' as DateTime), CAST('13:37:45' as DateTime)
I get the following results:
'1900-01-01 12:06:39.000' and '1900-01-01 13:37:45.000'
As you can see, the date portion is different and I expect that January 1st, 1900 is correct for this conversion. So, my questions are:
1. Why I have "previous" day in the Integration Services transformation?
2. How to fix this problem?
Thank you,
Vlad
Don't know why it is happening, but it seems like you could use DateAdd in a derived column pretty easily to add 2 days.|||
Microsoft SQL Server
Values with the datetime data type are stored internally by the Microsoft SQL Server 2005 Database Engine as two 4-byte integers. The first 4 bytes store the number of days before or after the base date: January 1, 1900.
SSIS
The DT_DATE data type is implemented using an 8-byte floating-point number. Days are represented by whole number increments, starting with 30 December 1899, and midnight as time zero.
No comments:
Post a Comment