大网数据广告活动
Web服务器与PHP

Error when you insert data into IBM DB2 database

· 52CE 我爱测

The following error occurs when using SQL Server Integration Services and the Microsoft OLE DB Provider for DB2 to insert NULL TimeStamp or Date values into IBM DB2 database when using FastLoad.

Original product version:   Host Integration Server
Original KB number:   2848234

Symptoms

Consider the following scenario:

  • You use SQL Server Integration Services (SSIS) and the OLE DB Provider for DB2 to insert data into an IBM DB2 database.

  • The OLE DB Destination in the SSIS package is configured with Accessmode = OpenRowset Using FastLoad.

  • The source SQL Server database includes some NULL values for columns defined as DateTime2 and Date data types that will be inserted into IBM DB2 columns defined as TimeStamp and Date data types, respectively.

During the SSIS process of inserting data into the IBM DB2 database, an error similar to the following error may occur:

Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft DB2 OLE DB Provider" Hresult: 0x80004005 Description: "Unspecified error".

An OLE DB record is available. Source: "Microsoft DB2 OLE DB Provider" Hresult: 0x80040E14 Description: "The syntax of the string representation of a datetime value is incorrect. SQLSTATE: 22007, SQLCODE: -180".

Resolution

There are two ways to resolve the problem.

  • Change the OLE DB Destination in the SSIS package to use AccessMode = OpenRowset to disable the use of FastLoad. The disadvantage of this option is that the performance of the inserts into the DB2 database will be much slower as each row is inserted one at a time.

  • Add the following parameter to the DB2 connection string used by SSIS to connect to the IBM DB2 system:

    Use Early Metadata=true

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 05/07/2024
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。