从 MySQL 到 SQL 服务器 unicode 和非 unicode 的 SSIS 数据流
SSIS Data Flow from MySQL to SQL Server unicode and non-unicdoe
我在 SSIS 的 Data Flow
任务中遇到“cannot convert between unicode and non-unicdoe string data types
”错误,我无法弄清楚原因。
- 我使用“
.Net Providers\Odbc Data Provider
”提供程序创建了到 MySQL DB
的 ADO.NET
连接,使用的连接字符串如下所示:Driver={MySQL ODBC 5.3 ANSI Driver};server=....
- 我有
OLE DB
连接到 SQL server
- 我有一个
Data Flow
任务
- 我有一个
ADO NET Source
使用 MySQL
连接
- 我有一个
OLE DB Destination
使用 SQL Server
连接
- 源 (
MySQL
) 中的所有列都是 varchar(50)
- 目标 (
SQL Server
) 中的所有列都是 varchar(50)
然而,OLE DB Destination
任务仍然出错,显示“Column "one" cannot convert between unicode and non-unicode string data types.
”
我尝试使用 Data Conversion
任务将所有内容转换为“string [DT_STR]
”,目标任务停止显示红色 X 但执行失败并显示“Error: Data conversion failed while converting column "one" (13) to column "copy of one" (32). The conversion returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page."
”
增加 one
和 copy of one
的列长度。 first/second 列的长度(位)不足。增加长度并尝试。如果 40,则将其更改为 >60。 Unicode 需要更多位来存储字符串。
我在 SSIS 的 Data Flow
任务中遇到“cannot convert between unicode and non-unicdoe string data types
”错误,我无法弄清楚原因。
- 我使用“
.Net Providers\Odbc Data Provider
”提供程序创建了到MySQL DB
的ADO.NET
连接,使用的连接字符串如下所示:Driver={MySQL ODBC 5.3 ANSI Driver};server=....
- 我有
OLE DB
连接到SQL server
- 我有一个
Data Flow
任务 - 我有一个
ADO NET Source
使用MySQL
连接 - 我有一个
OLE DB Destination
使用SQL Server
连接 - 源 (
MySQL
) 中的所有列都是varchar(50)
- 目标 (
SQL Server
) 中的所有列都是varchar(50)
然而,OLE DB Destination
任务仍然出错,显示“Column "one" cannot convert between unicode and non-unicode string data types.
”
我尝试使用 Data Conversion
任务将所有内容转换为“string [DT_STR]
”,目标任务停止显示红色 X 但执行失败并显示“Error: Data conversion failed while converting column "one" (13) to column "copy of one" (32). The conversion returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page."
”
增加 one
和 copy of one
的列长度。 first/second 列的长度(位)不足。增加长度并尝试。如果 40,则将其更改为 >60。 Unicode 需要更多位来存储字符串。