Hi, I have a table:
I have a text file with the following data:
"JOHNSON, BOB","1","SQUARE"
"PIPER, PETER",,"CIRCLE"
"JENKINS, LORI","13","RECTANGLE"
"SMITH, LISA",,"TRIANGLE"
I am trying to run a bulk insert. However....
If I use (with fieldterminator = ',') - the data file is split between the last name and the first name in the first field.
Also, the 2nd field doesn't use double quotes when it is empty. Instead of ,"", it's just ,,
I can do a few find/replaces in my text file to get where I need to go, but I'm hoping to set this up for someone else so they can insert the files we receive each day. Is there a way to keep the bulk insert from considering a comma if it falls within the double quotes? Like using a text qualifier or something?
Thanks!
Brian
Code:
create table #temp (field1 varchar(200), field2 varchar(200), field3 varchar(200))
I have a text file with the following data:
"JOHNSON, BOB","1","SQUARE"
"PIPER, PETER",,"CIRCLE"
"JENKINS, LORI","13","RECTANGLE"
"SMITH, LISA",,"TRIANGLE"
I am trying to run a bulk insert. However....
If I use (with fieldterminator = ',') - the data file is split between the last name and the first name in the first field.
Also, the 2nd field doesn't use double quotes when it is empty. Instead of ,"", it's just ,,
I can do a few find/replaces in my text file to get where I need to go, but I'm hoping to set this up for someone else so they can insert the files we receive each day. Is there a way to keep the bulk insert from considering a comma if it falls within the double quotes? Like using a text qualifier or something?
Thanks!
Brian