I\'m importing data from Oracle to SQL Server 2005 using SSIS. I think the datetime fields in Oracle are stored to a higher precision than SQL Server 2005 \"DATETIME\" fields wi
The issue in this is that SQL Server is limited in what dates are valid (January 1, 1753, through December 31, 9999), while Oracle dates from January 1, 4712 BCE through December 31, 9999. So any date in Oracle less than January 1, 1753 will overflow the datetime sql server datatype.
If you move up to Sql 2008 you can use Datetime2 type to help with this issue as that has valid dates from 0001-01-01 through 9999-12-31.
See details here: Sql Server Date and Time types
And here: Oracle Date Type
There is another cause. Check to make sure that the dates are valid. We are in the middle of this, and we have years specified as something like 5096, which apparently cannot be moved to SQL server... same goes if you have a year of 0207 instead of 2007.
I will suggest to use the following instruction in your SELECT statement:
CASE WHEN date_birth < TO_DATE('01-01-1753','DD-MM-YYYY') THEN NULL
ELSE to_char(date_birth, 'YYYY-MM-DD HH24:MI:SS') END AS date_birth
Just flagging this as 'answered' since there appears to be no global setting.