gpt4 book ai didi

sql-server - SSIS Access SQL。绑定(bind)错误: The binding status was "DT_NTEXT"

转载 作者:行者123 更新时间:2023-12-02 12:02:06 27 4
gpt4 key购买 nike

我正在尝试获取从以前的同事继承的SSIS包来执行。该包从 Access 数据库中提取数据,然后将数据放入 SQL 数据库中。

其中一个字段(我们称之为“推荐”)在 Access 数据库中属于“备忘录” 类型。 SQL 输出数据库中的列的类型为 varchar(max)。

Error: 0xC002F446 at Data Flow Task, OLE DB Destination [218]: An error occurred while setting up a binding for the "Recommendations" column. The binding status was "DT_NTEXT". The data flow column type is "DBBINDSTATUS_UNSUPPORTEDCONVERSION". The conversion from the OLE DB type of "DBTYPE_IUNKNOWN" to the destination column type of "DBTYPE_WVARCHAR" might not be supported by this provider.

让我更加困惑的是memo类型的不同列,它也被处理为DT_NTEXT,并且也被放入varchar(max) SQL 数据库中的数据类型,不会引发错误消息。我已经尝试了多种转换对象类型,但尚未成功执行包。

最佳答案

我能够通过执行以下操作来重现此错误:

  • 将目标列的数据类型更改为 nvarchar(100)
  • 使数据流中的传入行为 ntext,长度大于 100

这会导致目标列溢出并引发您在问题中所述的错误:

Error: 0xC002F446 at Data Flow Task, OLE DB Destination [2]: An error occurred while setting up a 
binding for the "myCol" column. The binding status was "DT_NTEXT". The data flow column type is
"DBBINDSTATUS_UNSUPPORTEDCONVERSION". The conversion from the OLE DB type of "DBTYPE_IUNKNOWN" to
the destination column type of "DBTYPE_WVARCHAR" might not be supported by this provider.

所以我认为您遇到的情况是 ntext 列的值超过了 nvarchar(max) 导致其溢出。

在之前的版本中,您将列转换为 dt_wstr(510) - 这之所以有效,是因为您可能会将 ntext 值截断为适合目标列的大小。如果这些值确实适合该大小,则将其作为解决方案。如果源值可能更大,请将 SQL 中的目标列更改为适合的值。这可以是 ntext,但它已被弃用,因此建议将其更改为 varbinary(max)

关于sql-server - SSIS Access SQL。绑定(bind)错误: The binding status was "DT_NTEXT",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26929438/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com