我正在尝试从 Excel
导入文件成SQL table
.当我从 unicode 转换时 string[DT_WSTR]
至 string[DT_STR]
通过数据转换,我在某些列上出现截断错误。这是输出错误:
[Data Conversion [2]] Error: Data conversion failed while converting column "Contact Name" (187) to column "DataContactName" (105). 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.".
所以数据流以失败告终,但有些行被复制到
sql table
.是否有一些解决方法或解决此问题的方法是什么?
最佳答案
这是你可以做的
Failure on error
更改为至 Ignore on error
.尽管您绝对应该输出错误并将其记录到平面文件中以检查丢失的数据。 关于你的评论:
I added ignore truncation errors in error output and all rows were copied in sql table. There was no problem to convert characters like ; or "á". Can u brief me what kind of errors i ignored?
我建议您在将失败设置更改为 from
Ignore Failure
后对错误输出使用多播转换。至 Redirect Row
.然后将 Multi-cast 的输出之一插入 SQL Server,并将其他输出插入到平面文件目标中。通过这种方式,您可以将数据输入 SQL Server 以及平面文件中以分析错误
关于sql-server - SSIS 截断错误返回状态 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44631278/