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 |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-08-10 : 07:44:05
|
Jim writes "I want to import a comma delimited file into SQL 2000. The data for most of the columns are surrounded by double quotes, but not all. Some of the data has commas in middle. I want to use a bulk insert to import the file. I can not use a comma for the FIELDTERMINATOR or double quotes and a comma either because of the problems mentioned above.It seems the best way to do this would be to make a bcp.fmt file and use it in the bulk insert.I have never made one before and the comma delimited file has 43 columns of data. Since I have not made one of these types of files before, I need a way that will make the file without mistakes in it.My question is:Is there a way to make the bcp.fmt file automatically or a way to make the file and let me edit it for the different FIELDTERMINATORs?" |
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2005-08-10 : 18:37:20
|
If you don't specify a format file, bcp will ask you a series of questions on the format of the data being imported. After this is finished, it will ask you if you want to save the format file. Have a read up in BOL under "bcp.fmt"HTH,Tim |
 |
|
|
|
|