首页 文章

从MySQL导入SQL Server时SSIS中的绑定错误

提问于
浏览
0

我是SSIS的新手,并且继承了一个非常简单的包,它将数据从MySQL数据库导入到SQL Server表(OLE DB Destination)中 . MySQL开发人员给了我一个新的查询来代替当前在数据流组件(ADO.NET Source)中使用的查询,据称它提供了与以前相同的输出列 . 我只是将其粘贴到SqlCommand字段中代替现有查询 . 但是当我执行包时,我得到五个错误:

Error: 0xC002F445 at Data Import, OLE DB Destination [202]: An error occurred while setting up a binding for the "Column1" column. The binding status was "DT_NTEXT".
Error: 0xC002F446 at Data Import, OLE DB Destination [202]: An error occurred while setting up a binding for the "Column2" 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.
Error: 0xC002F445 at Data Import, OLE DB Destination [202]: An error occurred while setting up a binding for the "Column3" column. The binding status was "DT_TEXT".
Error: 0xC002F445 at Data Import, OLE DB Destination [202]: An error occurred while setting up a binding for the "Column4" column. The binding status was "DT_TEXT".
Error: 0xC002F445 at Data Import, OLE DB Destination [202]: An error occurred while setting up a binding for the "Column5" column. The binding status was "DT_NUMERIC".

我在SQL Server 2012 SP1中使用SSIS . 请注意,ADO.NET源中的AllowImplicitStringConversion设置为True . 我有MySQL开发人员给我一个CSV直接在MySQL中运行查询的结果,所以我可以看到数据实际上是什么样子 .

  • 对于第一个错误(Column1的0xC002F445),“外部列”部分和“输出列”部分的数据类型为 Unicode text stream [DT_NTEXT] ,目标SQL Server表期望 NVARCHAR(max) . 我可能有什么绑定问题?

  • 对于第二个错误(Column2的0xC002F446),对于外部列部分和输出列部分,DataType为 Unicode text stream [DT_NTEXT] ,并且目标SQL Server表期望 NVARCHAR(15) . CSV中的结果集在此列中为每行包含'NULL' . 我不明白为什么会有问题,因为我们试图在15个字符的列中插入4个字符 .

  • 接下来的两列对于外部和输出类型都有 Unicode string [DT_WSTR] ,在目标中有 TEXT 类型 .

  • 对于外部和输出类型,最后一列为数字 [DT_NUMERIC] ,目标中为 NVARCHAR(MAX) 类型 . 鉴于此,我不明白为什么这是一个问题 .

任何人都可以就如何解决这些问题提供一些指导吗?

顺便问一下,每个错误中的 [202] 告诉我什么?

1 回答

  • 0

    从Excel文件(Excel源)导入OLE DB目标时出现类似问题,这给我一个像你的错误信息 . 当我的Excel文件中有一列超过255个字符,而我的包无法处理时,就会发生这种情况 .

    我的解决方案是将列导出到文本文件并导入它 .

相关问题