hi
i m trying to insert .csv file in ms sqlserver but its not working
my cvs file data formate below is
i m using this code
this code works not giviing any error but the quatation marks "" does't remove and ROWTERMINATOR does't work.
its show all data of csv file in one row.the last field (country) of my table shows all data
pls help me
i m trying to insert .csv file in ms sqlserver but its not working
my cvs file data formate below is
Code:
"12.204.8.120","12.204.8.151","214698104","214698135","VI","Virgin Islands, U.S." "12.204.8.152","12.204.8.159","214698136","214698143","PR","Puerto Rico" "12.204.8.160","12.204.8.175","214698144","214698159","VI","Virgin Islands, U.S." "12.204.8.176","12.204.8.183","214698160","214698167","PR","Puerto Rico" "12.204.8.184","12.204.8.191","214698168","214698175","VI","Virgin Islands, U.S." "12.204.8.192","12.204.8.255","214698176","214698239","PR","Puerto Rico" "12.204.9.0","12.204.9.79","214698240","214698319","VI","Virgin Islands, U.S." "12.204.9.80","12.204.9.127","214698320","214698367","PR","Puerto Rico" "12.204.9.128","12.204.9.135","214698368","214698375","VI","Virgin Islands, U.S." "12.204.9.136","12.204.9.143","214698376","214698383","US","United States" "12.204.9.144","12.204.10.143","214698384","214698639","PR","Puerto Rico" "12.204.10.144","12.204.10.159","214698640","214698655","VI","Virgin Islands, U.S." "12.204.10.160","12.204.12.223","214698656","214699231","PR","Puerto Rico"
Code:
use DBGMTEST Go Create table csvtest ( begin_addr char(50) not null, end_addr char(50) not null, begin_num varchar(50) not null, end_num varchar(50) not null, code char(20) not null, country varchar(max) not null, ) Go Bulk Insert csvtest from 'C:\GM\GeoIP.csv' with ( Fieldterminator = '","', ROWTERMINATOR = '\r\n' ) Go select * from csvtest Go Drop table csvtest Go
its show all data of csv file in one row.the last field (country) of my table shows all data
pls help me
Comment