我正在使用 SSIS 将数据从 MSSQL 传输到 MySQL。我已经完成了所有表的映射。但是在执行包时出现错误:
[tabl_name [1056]] Error: An exception has occurred during data insertion, the message returned from the provider is: ERROR [07006] [MySQL][ODBC 3.51 Driver][mysqld-5.1.33-community-log]Restricted data type attribute violation(SQL_C_NUMERIC)
[product [402]] Error: An exception has occurred during data insertion, the message returned from the provider is: Unable to cast object of type 'System.Int32' to type 'System.Char[]'.
我也比较了所有列的数据类型,发现是一样的。 之后我做了一些研究,发现数据类型 decimal(10,2) 有问题。但我找不到解决方案。
提前致谢。
最佳答案
摆脱此类问题的一种简单方法是临时将有问题的列从 decimal 转换为 varchar,在完成迁移后,将其转换回 decimal。
以上可以适用于 MSSQL,因为错误是在 MSSQL 报错的。
关于执行SSIS包时出现mysql错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4584358/