SSIS 数据流在日期上溢出
我有一个 FoxPro 数据源,目标是 SQL Server 2008。
在 FoxPro 端,我有一个数据类型为 Date
的列。宽度为 8,最小值为 0001-01-01,最大值为 9999-12-31。在 SQL Server 端,我有一个日期时间
。宽度也是 8,最小值为 1753-01-01,最大值为 9999-12-31。
在我的 SSIS 数据流任务中,我有一个读取 FoxPro 表的 OLE DB 源组件。这些列在外部列和输出列中都映射为 DT_DBDate。 SQL Server 表的 OLE DB 目标采用该列并将其流向 DT_DBTIMESTAMP。我确信 DT_DBTIMESTAMP 可以充分处理这些日期范围,并且对 DT_DBDATE 相当确定(但在 MS 文档中找不到它)。
问题
当我执行任务时,我一直遇到失败的问题,并在遇到值时抱怨“无效的日期格式”,然后“转换失败,因为数据值溢出了特定类型”从 1900 年代初左右到 2050 年以上的值。我不太确定我哪里出了问题。
奖励问题
如何处理数据流任务中的溢出?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能想要执行一个简单的 VFP 查询来查找超出范围的记录,例如
查看这些记录是否存在问题的 VFP 查询...
此外,查看可能导致边界问题的其他列
you might want to do a simple VFP query looking for the records that are beyond the range such as a VFP query of
look at those records for problems...
Additionally, look at other columns that may be causing your boundary issues
我认为您需要决定要如何处理数据
如果您想按原样加载数据,则需要更改字段数据类型,以便它将能够保存数据。
或者,如果您希望纠正错误的数据,则需要验证和转换它。
如果您愿意花一些钱,请考虑使用高级 ETL 处理器。
它适用于文本、XML、Excel、Access、DBF、Foxpro、ODBC、OLE DB、MS Sql Server、Oracle、MySql、PostgreSQL、Firebird、Interbase、SQLite、POP3、SMTP、文件系统、FTP、SSL 和 Unicode。
I think you need to decide what do you want to do with your data
If you want to load it as it is, you need to change field data type so it will be able to hold the data.
Or if you any wish to correct wrong data you would need to validate and transform it.
If you willing to spend some money please consider using Advanced ETL Processor.
It works with Text, XML, Excel, Access, DBF, Foxpro, ODBC, OLE DB, MS Sql Server, Oracle, MySql, PostgreSQL, Firebird, Interbase, SQLite, POP3, SMTP, File System, FTP, SSL and Unicode.