Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dgaylor
Yak Posting Veteran
54 Posts |
Posted - 2003-08-21 : 16:28:08
|
| Is it possible to bcp import a comma delimited file that has quotes around the fields, so that the quotes don't end up in the table? Thanks. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-08-21 : 16:42:05
|
| I don't think that bcp can do this. Just run bcp /? in a cmd window to see the options. I don't see a text qualifier option. DTS allows the text qualifier option though.Tara |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2003-08-21 : 17:27:32
|
| Files like this cause so much headache. It's not "comma delimited" if the fields are enclosed in quotes, is it. But yes, DTS does allow for this.Jonathan{0} |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-08-21 : 17:30:11
|
| Well in DTS, you could have a comma delimited file and also have quotes around the text columns. bcp doesn't allow this, at least as far as I can tell. The quotes aren't delimiters, but rather an indication to the import/export program of which columns are text (meaning varchar, char, etc...).Tara |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-08-21 : 20:56:42
|
| You can work around it with this technique:http://www.sqlteam.com/item.asp?ItemID=3207Also, you may want to try using a bcp format file. I haven't tried incorporating quotes into the column terminators, but I think it will let you do it. See Books Online for a sample of format file layout. The column terminator would be something like "","" |
 |
|
|
dgaylor
Yak Posting Veteran
54 Posts |
Posted - 2003-08-22 : 14:40:42
|
| thanks for the great info. |
 |
|
|
|
|
|