1

I have a FoxPro data source, and the destination is SQL Server 2008.

On the FoxPro side, I have a column with the Date data type. That's a width of 8, min value is 0001-01-01 and max is 9999-12-31. On the SQL Server side, I have a datetime. Also a width of 8, min value is 1753-01-01 and max is 9999-12-31.

In my SSIS Data Flow task, I have an OLE DB Source component that reads in the FoxPro table. The columns are mapped as DT_DBDate in both External and Output Columns. The OLE DB Destination to the SQL Server table takes that columns and flows it to a DT_DBTIMESTAMP. I'm sure that DT_DBTIMESTAMP can handle these date ranges adequately, and reasonably sure about DT_DBDATE (but am having trouble finding it in MS documentation).

The Problem

When I execute the task, I've been having trouble with it failing and complaining of "Invalid date format" and then "Conversion failed because the data value overflowed the specific type" when it encounters values from around the early 1900s, to values over 2050. I'm not exactly sure where I've gone wrong.

Bonus Question

How can I handle overflows in my data flow task?

4

2 回答 2

2

您可能想做一个简单的 VFP 查询来查找超出范围的记录,例如 VFP 查询

select * from yourtable
   where YourDate < date( 1753, 1, 1 )
      or YourDate > date( 9999, 12, 31 )

查看这些记录是否存在问题...此外,请查看可能导致您的边界问题的其他列

于 2010-12-02T12:41:44.377 回答
1

我认为您需要决定要如何处理您的数据

如果要按原样加载它,则需要更改字段数据类型,以便它能够保存数据。

或者,如果您希望更正错误数据,则需要对其进行验证和转换。

如果您愿意花一些钱,请考虑使用高级 ETL 处理器。

它适用于文本、XML、Excel、Access、DBF、Foxpro、ODBC、OLE DB、MS Sql Server、Oracle、MySql、PostgreSQL、Firebird、Interbase、SQLite、POP3、SMTP、文件系统、FTP、SSL 和 Unicode。

于 2010-12-15T17:50:11.170 回答