文件名 abc.txt 存储位置: D:/
文件内容:
0.0.0.0,0.255.255.255,IANA, CZ88.NET,0,16777215
1.0.0.0,1.51.255.255,IANA, CZ88.NET,16777216,20185087
1.52.0.0,1.52.255.255,美国, CZ88.NET,20185088,20250623
1.53.0.0,1.153.255.255,IANA, CZ88.NET,20250624,26869759
1.154.0.0,1.154.255.255,美国, CZ88.NET,26869760,26935295
1.155.0.0,1.255.255.255,IANA, CZ88.NET,26935296,33554431
2.0.0.0,2.255.255.255,IANA, CZ88.NET,33554432,50331647
3.0.0.0,3.255.255.255,美国,新泽西通用电气公司,50331648,67108863
4.0.0.0,4.9.255.255,美国, CZ88.NET,67108864,67764223
4.10.0.0,4.10.255.255,美国,新泽西州立大学,67764224,67829759
4.11.0.0,4.11.255.255,美国,夏威夷,67829760,67895295
4.12.0.0,4.19.77.255,美国, CZ88.NET,67895296,68374015
4.19.78.0,4.19.78.255,美国,西南政法大学,68374016,68374271
4.19.79.0,4.19.79.63,美国,Armed Forces Radio/Television,68374272,68374335
4.19.79.64,4.21.176.255,美国, CZ88.NET,68374336,68530431
4.21.177.0,4.21.177.255,美国,西南政法大学,68530432,68530687
4.21.178.0,4.36.124.127,美国, CZ88.NET,68530688,69500031
4.36.124.128,4.36.124.255,美国,Technical Resource Connections Inc,69500032,69500159
4.36.125.0,4.36.127.255,美国,坦帕大学,69500160,69500927
4.36.128.0,4.37.215.255,美国, CZ88.NET,69500928,69588991
4.37.216.0,4.37.219.255,美国,德克萨斯女子大学,69588992,69590015
4.37.220.0,4.41.60.255,美国, CZ88.NET,69590016,69811455
4.41.61.0,4.41.61.255,美国,EARTHLINK公司,69811456,69811711
4.41.62.0,4.42.255.255,美国, CZ88.NET,69811712,69926911
4.43.0.0,4.43.255.255,美国,罗斯门特学院,69926912,69992447
4.44.0.0,4.208.48.255,美国,Genuity用户,69992448,80752895
4.208.49.0,4.208.49.255,美国,加洲,80752896,80753151
4.208.50.0,4.237.255.255,美国,Genuity用户,80753152,82706431
4.238.0.0,4.239.255.255,美国,宾夕法尼亚州,82706432,82837503
4.240.0.0,4.255.255.255,美国,Genuity用户,82837504,83886079
5.0.0.0,5.147.255.255,IANA, CZ88.NET,83886080,93585407
5.148.0.0,5.148.255.255,加拿大, CZ88.NET,93585408,93650943
5.149.0.0,5.255.255.255,IANA, CZ88.NET,93650944,100663295
6.0.0.0,8.255.255.255,美国,DoD网络信息中心,100663296,150994943
9.0.0.0,9.255.255.255,美国,纽约IBM公司,150994944,167772159
10.0.0.0,10.255.255.255,局域网,对方和您在同一内部网,167772160,184549375
11.0.0.0,11.255.255.255,美国,DoD网络信息中心,184549376,201326591
12.0.0.0,12.0.47.255,美国,ATT用户,201326592,201338879
12.0.48.0,12.0.63.255,美国,哈佛大学,201338880,201342975
12.0.64.0,12.2.168.255,美国,ATT用户,201342976,201500927
12.2.169.0,12.2.169.255,美国,Leepfrog Technologies,201500928,201501183
12.2.170.0,12.3.133.255,美国,ATT用户,201501184,201557503
12.3.134.0,12.3.135.255,美国,Lycoming College,201557504,201558015
12.3.136.0,12.5.176.239,美国,ATT用户,201558016,201699567
12.5.176.240,12.5.176.255,美国,Friends University,201699568,201699583
12.5.177.0,12.6.207.255,美国,ATT用户,201699584,201773055
12.6.208.0,12.6.223.255,美国,哈佛大学,201773056,201777151
12.6.224.0,12.6.229.255,美国,ATT用户,201777152,201778687
12.6.230.0,12.6.231.255,美国,Marlboro College,201778688,201779199
12.6.232.0,12.11.138.255,美国,ATT用户,201779200,202083071
12.11.139.0,12.11.139.255,美国,南佛蒙特学院,202083072,202083327
12.11.140.0,12.13.176.127,美国,ATT用户,202083328,202223743
12.13.176.128,12.13.176.255,美国,Spelman College,202223744,202223871
12.13.177.0,12.16.215.255,美国,ATT用户,202223872,202430463
12.16.216.0,12.16.219.255,美国,太平洋联合学院,202430464,202431487
12.16.220.0,12.19.229.255,美国,ATT用户,202431488,202630655
12.19.230.0,12.19.230.255,美国,Houghton College,202630656,202630911
12.19.231.0,12.22.84.255,美国,ATT用户,202630912,202790143
12.22.85.0,12.22.85.255,美国,新泽西,202790144,202790399
12.22.86.0,12.22.177.255,美国,ATT用户,202790400,202813951
12.22.178.0,12.22.179.255,美国,First Technology Solutions,202813952,202814463
12.22.180.0,12.25.238.223,美国,ATT用户,202814464,203026143
12.25.238.224,12.25.238.255,美国,InFlow STL01,203026144,203026175
12.25.239.0,12.38.253.255,美国,ATT用户,203026176,203881983
12.38.254.0,12.38.254.31,美国,卡森纽曼学院,203881984,203882015
-->先创建一个表(字段类型及数量跟要导入的文件要匹配)
if object_id('tb')is not null
drop table tb
go
create table tb(ip1 varchar(20),ip2 varchar(20),col1 varchar(20),col2 varchar(50),ip1s bigint,ip2s bigint)
EXEC master..xp_cmdshell 'bcp test1..tb in d:/abc.txt -c -t , -SFI6 -Usa -P123'
/*
NULL
开始复制...
NULL
已复制 65 行。
网络数据包大小(字节): 4096
总时钟时间(毫秒) : 63 平均值: (每秒 1031.75 行。)
NULL
*/
select * from tb