导致SSIS中“转换规范的字符值无效”的日期数据

时间:2012-01-27 20:17:16

标签: ssis ibm-midrange

我有一个SSIS导出包,用于将数据从iSeries系统导出到SQL Server。我正在向包中添加一个新表导出,该表包含两个日期字段。我的SSIS包通过ODBC连接到iSeries数据库。我可以连接到我想要导出的数据表,在MS Access中没有问题,我可以毫无困难地浏览和查看所有数据。但是,我在日期字段中收到来自SSIS的可怕"Invalid character value for cast specification"错误消息。

如何诊断具体问题?我很确定可能有一些方法可以在SSIS中转换这些数据,我只是不知道如何重新格式化数据,因为我无法在MS Access的原始状态下预览它。我的问题非常通用 - 我可以做些什么来解决这个问题或解决问题?

谢谢开发者!仅供参考,以下数据是我测试任务时Visual Studio的完整错误详细信息。

Error: 0xC0202009 at [iSeriesTable], [SSIS Task] [113]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Invalid character value for cast specification".
Error: 0xC020901C at [iSeriesTable], [SSIS Task] [113]: There was an error with input column "date_field" (178) on input "OLE DB Destination Input" (126). The column status returned was: "Conversion failed because the data value overflowed the specified type.".
Error: 0xC0209029 at [iSeriesTable], [SSIS Task] [113]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "input "OLE DB Destination Input" (126)" failed because error code 0xC020907A occurred, and the error row disposition on "input "OLE DB Destination Input" (126)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
Error: 0xC0047022 at [iSeriesTable]: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "[SSIS Task]" (113) failed with error code 0xC0209029. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.
Error: 0xC0047021 at [iSeriesTable]: SSIS Error Code DTS_E_THREADFAILED.  Thread "WorkThread0" has exited with error code 0xC0209029.  There may be error messages posted before this with more information on why the thread has exited.

2 个答案:

答案 0 :(得分:3)

尝试将其带入varchar()或其他字符串或文本类型字段,而不是日期字段。某些后端接受SQL Server无法直接处理的日期,因此需要在导入之前进行转换。

答案 1 :(得分:0)

确保IBM i表中的列定义为DATE,而不是ZONED,PACKED或INTEGER。