Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with BULK INSERT

Status
Not open for further replies.

faust13

Programmer
Aug 7, 2001
176
US
How do I get BULK INSERT to use double quotes as the text qualifier?
 
You should probably use DTS as it will handle the double quotes quite easily.

There is an article at TechNet that discusses data import methods. It shows a way to import double quote delimited strings. The process involves building a format file like BCP uses. (BCP has the same problem with double quotes!) From what I've read, the method in the article works in SQL 2000 but probably not for SQL 7 Bulk Inserts.


Another option is to allow Bulk Insert to import the double quotes and then run an update query to replace the quotes with an empty string.

Update table set col1=replace(col1,'"',''), col2=replace(Col2,'"',''), ...
Where <criteria>

This is not efficient and I don't recommend it unless the number of rows to be updated is small. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top