SQL Server: Text was truncated or one or more characters had no match in the target code page error
来源:互联网 发布:达内软件测试学院 编辑:程序博客网 时间:2024/06/11 01:44
导入CSV到SQL Server真是一件美好的事情,这是转自一个外国人博客里的部分解决方案。但我想吐槽的远不止这个。
1. 如果你的csv比较干净,也就是指一项数据中没有逗号“,”的话,通过下面的方法改改字段长度就好了(微软你们真懒啊,遍历一遍自动设个长度不行啊)
When trying to import a CSV file into a database using the “Import Data” SSIS option in SQL Server Management Studio I kept getting this error:
“Text was truncated or one or more characters had no match in the target code page.”
This was driving me nuts – such a simple thing to do and the tool failed each time. Turns out that, for whatever reason, and despite the data import wizard realising the target table has enough room in the columns, that you have to click on the Advanced tab and say what the size of the destination table columns are going to be (this is before you have selected the destination of course).
Once you’ve done this the import should now work perfectly.
You would have thought by now that Microsoft would have made this a bit more intelligent by now…
2. 如果不幸的,你的数据比较复杂,比如某一行数据是这样的
北京大学, 2012, 40000, "北京,海淀区"
以我目前的测试情况是,最后的"北京,海淀区"会被切成两个数据,即 ("北京) 和 (海淀区"),引号MS你都不处理让人哭啊。
折中方案,转换成excel或者其他格式再进行导入,这样sql server就会把数据项区分正确,运气好的话就走通了。
3. 如果还很不幸,和我一样,导成excel之后还是这个问题,还是报告数据超过字段长度,那么,我目前还没解决~我尝试过把对应字段改成text但依然报错,试试再曲线救国转成别的可能不会报错的格式再导入吧。
- SQL Server: Text was truncated or one or more characters had no match in the target code page error
- Sql Server 启动时cannot find one or more components, Please reinstall the application.
- SQL Server Error Messages - Msg 1776 : There are no primary or candidate keys in the referenced Table
- The server encountered an internal error or misconfiguration and was ...
- 卸载v2010后 sql server 2014 报错sql2014 Cannot find one or more components.Please reinstall the applicati
- “No mapping for the Unicode character exists in the target multi-byte code page” 错误解决方法
- ERROR 1269 (HY000): Can't revoke all privileges for one or more of the requested users
- How to solve "one or more projects in the solution were not loaded correctly" problem?
- System.Runtime.InteropServices.COMException(0x8004020F): The server rejected one or more recipient addresses.
- The server timezone value 'UTC' is unrecognized or represents more than one timezone
- The server time zone value 'EDT' is unrecognized or represents more than one time zone.
- Mysql错误:The server time zone value is unrecognized or represents more than one time zone
- The server time zone value 'PDT' is unrecognized or represents more than one time zone
- The server timezone value 'xxx' is unrecognized or represents more than one time
- Internal Server Error The server encountered an internal error or misconfiguration and was unable to
- 连接数据库:ERROR: The server time zone value '�й�' is unrecognized or represents more than one time zone
- Microsoft SQL Server Management Studio cannot find one or more components的问题
- SQL Server 2014 启动错误及解决:Cannot find one or more componets
- 【干货】国外程序员整理的 C++ 资源大全
- M-JPEG、H.261/H.263、MPEG4、H.264这4种压缩方式有什么区别
- C 语言中的左值和右值。以及对比数组名和指针取数组元素的区别。
- C#线程间操作无效: 从不是创建控件" XX" 的线程访问它
- 数据结构(java语言描述)-- 二叉查找树的链式存储结构的实现
- SQL Server: Text was truncated or one or more characters had no match in the target code page error
- wikioi 1098 均分纸牌
- java5新特性之静态导入
- 数据库设计三大范式
- 解决:由于Web服务器上的“ISAPI”和“CGI限制”列表设置,无法提供您所请求的页面
- hdfs文件乱码问题
- 6.4.1 使用 map 函数
- jedis使用线程池封装redis基本操作
- SharePoint中开发自定义Timer Job