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 - 2004-12-17 : 06:43:33
|
| Roger writes "Hi,What is the best way to read a comma delimited text file which does not have a fixed number of input columns? I am using bulk insert which works fine when there is a fixed number of input columns in the input text file. But, in cases where some records in the input text file have less input columns then others, the bulk insert command starts loading the extra columns from the next record. I have specified the record terminator field (which should be a carrage return) but it still does not work. Otherwise should I use BCP if BCP will allow for variable number of input fields?I am using:with (fieldterminator = ''","'', rowterminator = ''\n'', keepnulls, tablock)Thanks,Roger" |
|
|
Hyukevain
Yak Posting Veteran
66 Posts |
Posted - 2004-12-22 : 11:49:00
|
| Use DTS and set the transformation dinamically by using script depend on how many field exist in your text file. Can this help ? |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
|
|
|
|
|