全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SQL及关系型数据库数据分析
3001 2
2018-11-15
数据内容如图

1|AAAAAAAABAAAAAAA|1998-01-01|||2450952|NY Metro|large|2|1138|8AM-4PM|Bob Belcher|6|More than other authori|Shared others could not count fully dollars. New members ca|Julius Tran|3|pri|6|cally|730|Ash Hill|Boulevard|Suite 0|Midway|Williamson County|TN|31904|United States|-5|0.11|
2|AAAAAAAACAAAAAAA|1998-01-01|2000-12-31||2450806|Mid Atlantic|medium|6|2268|8AM-8AM|Felipe Perkins|2|A bit narrow forms matter animals. Consist|Largely blank years put substantially deaf, new others. Question|Julius Durham|5|anti|1|ought|984|Center Hill|Way|Suite 70|Midway|Williamson County|TN|31904|United States|-5|0.12|
3|AAAAAAAACAAAAAAA|2001-01-01|||2450806|Mid Atlantic|medium|6|4134|8AM-4PM|Mark Hightower|2|Wrong troops shall work sometimes in a opti|Largely blank years put substantially deaf, new others. Question|Julius Durham|1|ought|2|able|984|Center Hill|Way|Suite 70|Midway|Williamson County|TN|31904|United States|-5|0.01|
4|AAAAAAAAEAAAAAAA|1998-01-01|2000-01-01||2451063|North Midwest|medium|1|649|8AM-4PM|Larry Mccray|2|Dealers make most historical, direct students|Rich groups catch longer other fears; future,|Matthew Clifton|4|ese|3|pri|463|Pine Ridge|RD|Suite U|Midway|Williamson County|TN|31904|United States|-5|0.05|
5|AAAAAAAAEAAAAAAA|2000-01-02|2001-12-31||2451063|North Midwest|small|3|795|8AM-8AM|Larry Mccray|2|Dealers make most historical, direct students|Blue, due beds come. Politicians would not make far thoughts. Specifically new horses partic|Gary Colburn|4|ese|3|pri|463|Pine Ridge|RD|Suite U|Midway|Williamson County|TN|31904|United States|-5|0.12|
6|AAAAAAAAEAAAAAAA|2002-01-01|||2451063|North Midwest|medium|7|3514|8AM-4PM|Larry Mccray|5|Silly particles could pro|Blue, due beds come. Politicians would not make far thoughts. Specifically new horses partic|Gary Colburn|5|anti|3|pri|463|Pine Ridge|RD|Suite U|Midway|Williamson County|TN|31904|United States|-5|0.11|

在txt中查看,换行也是'|',用bulk insert导入数据的话应该怎么设置换行符呢
bulk insert call_center from 'C:\Users\sunch\Desktop\计算机基础 课件\SQL\案例数据\TPC-DS1.1.0-1\call_center.dat'
     with (fieldterminator = '|',rowterminator = '\n');

这样写的话报错
消息 4863,级别 16,状态 1,第 1 行
第 1 行、第 32 列(cc_align)出现大容量加载数据转换错误(截断)。
附件列表
KD2K4K2BE4_U34R$[Y`2S_S.png

原图尺寸 6.16 KB

KD2K4K2BE4_U34R$[Y`2S_S.png

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2018-11-15 12:40:58
虽然不知道为什么,但是可以用ASCII码解决,把换行符改成0x0A就可以了

bulk insert call_center from 'C:\Users\sunch\Desktop\计算机基础 课件\SQL\案例数据\TPC-DS1.1.0-1\call_center.dat'
      with (fieldterminator = '|',rowterminator = '0x0A');
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2018-11-27 19:35:36
将数据文件用txt打开另存为ASCII编码后再导入
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群