Solved

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

Posted on 2007-11-21
5
713 Views
Last Modified: 2010-05-18
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
Comment
Question by:xenium
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20332758
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
 

Author Comment

by:xenium
ID: 20333844
Ok thanks for the info.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 20333849
0
 

Author Comment

by:xenium
ID: 20333857
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
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20333867
as you have extra "," and quotes around, no way around the format file, sorry
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question