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 |
|
TRACEYSQL
Aged Yak Warrior
594 Posts |
Posted - 2009-07-23 : 18:04:13
|
| bulk insert dbo.IMPORT_DATAfrom 'c:\Myfile.csv' with (FIRSTROW=2,FIELDTERMINATOR='","',ROWTERMINATOR = '')Data is DATETIME, COL2, COL3"7/22/09 9:39 AM","2.85E-05","7.45E-05""7/22/09 9:39 AM","0","0.017333333""7/22/09 9:40 AM","0","0.008008342"It brings it in with the " " Any ideas to get rid of the ""Cheers |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-07-23 : 21:33:33
|
[code]update IMPORT_DATAset <col name> = replace( <col name> , '"', '')[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
TRACEYSQL
Aged Yak Warrior
594 Posts |
Posted - 2009-07-23 : 22:42:31
|
| I was hoping not to do update afterwards as so many columns in table 130 ....and millions of rows.Hmmm |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-07-23 : 22:57:42
|
all the value is enclosed in double quote " " ?try use "," as delimiter KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
TRACEYSQL
Aged Yak Warrior
594 Posts |
Posted - 2009-07-23 : 23:03:19
|
| Thanks i give it a try |
 |
|
|
TRACEYSQL
Aged Yak Warrior
594 Posts |
|
|
Jeff Moden
Aged Yak Warrior
652 Posts |
Posted - 2009-07-26 : 12:59:43
|
If you use a good and proper BCP format file, you won't even need to do that.--Jeff Moden "Your lack of planning DOES constitute an emergency on my part... SO PLAN BETTER! ""RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row" |
 |
|
|
|
|
|
|
|