• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 735
  • Last Modified:

how to BCP upload a simple CSV file without a format file

I answered this question while typing it, so it's just here for the record!


bcp %DBNAME%.dbo.parm_Global in parm_Global.txt -S %SERVERNAME% -T -t, -c


But any tips on handling strings in quotation marks? so that string can contain commas?

Thanks





0
xenium
Asked:
xenium
  • 3
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you will need format file to configure the places where you have a "column delimiter" of quotes or the like.
the problem is the same as for the commas, though, as you might have some data with quotation marks also...
0
 
xeniumAuthor Commented:
Ok thanks for the info.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
0
 
xeniumAuthor Commented:
Is there any way to import csv without format file? I guess a straight copy and then an sp applied to the load would do it.

Any further info is extra points.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
as you have extra "," and quotes around, no way around the format file, sorry
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now