Thursday, March 29, 2012

Error loading Oracle DATE data

Hello.

I'm trying to put in an SQL server database some data extracted from Oracle Server 9i.

During the load process, the "OLE DB Destination" in the task chokes up when it finds a record containing the date '0197-01-01 00:00:00' (i got this by putting the error output to a column of type varchar(50)). I can't use the Condicional Split's date functions to filter this out because they also choke on the strange date.

Can anyone give a sugestion?

Thanks in advance,

Hugo Oliveira

SQL will not recognize that as a date. Valid ranges for a datetime column are January 1, 1753, through December 31, 9999. If you want to filter it out use the error output like you're doing.|||

Hello Brent.

I gess the error output is the only solution. Just wondering if there was another one.

Thanks,

Hugo Oliveira

|||

You could treat the value as a string, test it to see if its a valid date and if it is is, cast it as a date.

Those that are not a valid date - its up to you what you do with them. You could discard them or replace the value with a default.

-Jamie

No comments:

Post a Comment