May 17, 2012 at 2:56 am
Hi,
I would like to import a csv file to my Database. The import should captured the Double Quotes(") and Single Quotes(')->(without delimited )
1.Platform: SQL analyzer.
2.SQL Script:
BULK INSERT Data.dbo.DailyListing
FROM 'D:\Listing\Daily\Listing.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = ''
)
3.Error Message:
Server: Msg 4863, Level 16, State 1, Line 1
Bulk insert data conversion error (truncation) for row 19526, column 1 (ItemCode).
Server: Msg 4863, Level 16, State 1, Line 1
Bulk insert data conversion error (truncation) for row 19527, column 1 (ItemCode).
4.Sample of CSV
ItemCode | Description | Packing
SSPVGRTB50GX100 | PUFF 2 | 100X50G
SSPZBPCC6"X48 | PIZZA 6" - CC | 48 X 6"
SSPZBPAA6'X48 | PIZZA 6' - BB | 48 X 6'
SSPZBPBB6"X48 | PIZZA 6" - AA | 48 X 6"
SSPVGRTB50GX100 | PUFF - 2 | 100X50G
Got any way to import the Double and single quotes to DB?
Please help...:w00t:
May 17, 2012 at 3:08 am
There's tons of information about this on the web. Here's an example:
John
May 17, 2012 at 3:50 am
Hi John,
The Link that you given only shown sample to remove double and single quotes.
But for my case, i need include the quotes.
Anyway thanks for your reply.:-)
Please help again...
May 17, 2012 at 4:00 am
Well, that isn't the only resource available. I'm sure your search engine works just as well as mine does.
Are you using a format file? That's the way to control what does and doesn't get imported, and how.
John
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply