请选择 进入手机版 | 继续访问电脑版
楼主: 孙悟充
2626 2

sql server2017导入dat文件怎么做 [推广有奖]

  • 0关注
  • 1粉丝

大专生

76%

还不是VIP/贵宾

-

威望
0
论坛币
88 个
通用积分
4.1091
学术水平
0 点
热心指数
1 点
信用等级
0 点
经验
701 点
帖子
44
精华
0
在线时间
42 小时
注册时间
2018-3-28
最后登录
2019-5-8

孙悟充 学生认证  发表于 2018-11-15 09:27:26 |显示全部楼层 |坛友微信交流群
相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
数据内容如图

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)出现大容量加载数据转换错误(截断)。
二维码

扫码加我 拉你入群

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

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

关键词:sqlsever SqlServer sql dat Server数据库之间如何进行数据导入导出

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');

使用道具

kejiayuan0806 在职认证  发表于 2018-11-27 19:35:36 |显示全部楼层 |坛友微信交流群
将数据文件用txt打开另存为ASCII编码后再导入

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-3-28 19:00