July 13, 2010 at 3:34 am
1st ever post so apologies if this isn't in the correct forum....
I have a CSV file that I'm trying to import but every record (not field) is enclosed in double quotes... (sql 2005)
e.g
"row1, row2, row3," --header row
"a,b,c," --Data row
The data ends up in a table but the data for the 1st record looks like this "a, b, c".
How do i get rid of the double quotes on import?
Cheers
Chris
July 13, 2010 at 6:32 am
Thanks Stewartc,
The SSIS route worked fine, its just a pain I have to create a package for every load. I'm guessing there's no way to do this via the import/export wizard?
I'm a bit of a novice when it comes to the BCP command line stuff, would this automatically exclude the double quotes.
Thanks for the help.
July 13, 2010 at 11:30 pm
christopher.hawkes (7/13/2010)
1st ever post so apologies if this isn't in the correct forum....I have a CSV file that I'm trying to import but every record (not field) is enclosed in double quotes... (sql 2005)
e.g
"row1, row2, row3," --header row
"a,b,c," --Data row
The data ends up in a table but the data for the 1st record looks like this "a, b, c".
How do i get rid of the double quotes on import?
Cheers
Chris
Make a BCP format file using " \ " \ r \ n" (without the spaces I had to use to get this to show up on this forum) as the final delimiter and skip the first " as a single character column that won't be imported using a delimiter of "" because there is no delimiter between the first and second character. See Books Online for how to do such a thing.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply