hi
i m trying to insert .csv file in ms sqlserver but its not working
my cvs file data formate below is -
"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"
i m using this 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
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
1 2355
Use a format file.Here, read this...
Happy Coding!!!
~~ CK
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ragnorack67 |
last post by:
Hi, I need some advice on what to do. I have this MySQL insert file,
with about 30,000 records. One of the datafields has names in it. When
this list was put together, apparently there was extra...
|
by: Chris Petersen |
last post by:
Is there a better/simpler way than this?
use POSIX ('strftime');
my $dateCreated = strftime "%b %d, %Y %H:%M", localtime
((stat("c:\\test.txt")));
How would I go about displaying the output...
|
by: Rob |
last post by:
Hey, I'm pretty new to MySQL and have a question.
I've built a database locally and have inputed some information. I
need to go back and update some records, specifically by taking long
pieces...
|
by: TThai |
last post by:
HI,
I'm trying to insert records to a table using bcp command. The
problem is the input file to the bcp is a text file that looks like
this:
Text file data:
1234 abc def ghi jkl mno
...
|
by: pk |
last post by:
Sorry for the piece-by-piece nature of this post, I moved it from a
dormant group to this one and it was 3 separate posts in the other
group. Anyway...
I'm trying to bulk insert a text file of...
|
by: tano |
last post by:
Hello,
I have to insert a char in the middle of a string, I have written two functions
but I don't know what is the better? The problem is: if I use malloc() I copy
all the string with the new...
|
by: Tom |
last post by:
Hi,
I have a vb.net program from wich i want to open a ms word-doc
and insert an other document into it.
But i want it to work on every version of word (minimum word 2000).
can anyone help...
|
by: KELVIN TRAN |
last post by:
There are anyway to insert a picture or MS Word file in this text box
(Make easy for question or discussion)?
Thank you very much for your help.
Best regards,
Kelvin Tran
*** Sent via...
|
by: DeepthiSem |
last post by:
Hi Everyone
I have an issue while saving .rpt file into DB2 database using C# windows application.
The provider i have used is OLEDB provider. It is not supporting to insert large amount of data...
|
by: alivip |
last post by:
I write code to get most frequent words in the file
I won't to implement bigram probability by modifying the code to do the following:
How can I get every Token (word) and ...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |