Solved

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

Posted on 2007-11-21
5
681 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
  • 3
  • 2
5 Comments
 
LVL 142

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 142

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 142

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now