文本被截断或一个或多个字符在目标代码页中不匹配,包括逆透视中的主键 [英] Text was truncated or one or more characters had no match in the target code page including the primary key in an unpivot

查看:30
本文介绍了文本被截断或一个或多个字符在目标代码页中不匹配,包括逆透视中的主键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将平面文件导入 oledb 目标 sql server 数据库.

I'm trying to import a flat file into an oledb target sql server database.

这是给我带来麻烦的领域:

here's the field that's giving me trouble:

这里是平面文件连接的属性,特别是字段:

here are the properties of that flat file connection, specifically the field:

错误信息如下:

[来源 - 18942979103_txt [424]] 错误:数据转换失败.这列收件人姓名"的数据转换返回状态值 4和状态文本文本被截断或一个或多个字符没有匹配目标代码页.".

[Source - 18942979103_txt [424]] Error: Data conversion failed. The data conversion for column "recipient-name" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

我做错了什么?

推荐答案

我知道这是一个老问题.我解决它的方法 - 在通过增加长度甚至更改为数据类型文本失败后 - 创建一个 XLSX 文件并导入.它准确地检测了数据类型,而不是将所有列都设置为 varchar(50).事实证明,该列的 nvarchar(255) 也会这样做.

I know this is an old question. The way I solved it - after failing by increasing the length or even changing to data type text - was creating an XLSX file and importing. It accurately detected the data type instead of setting all columns as varchar(50). Turns out nvarchar(255) for that column would have done it too.

这篇关于文本被截断或一个或多个字符在目标代码页中不匹配,包括逆透视中的主键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆