Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-11-21
5
Medium Priority
?
724 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 150 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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 article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
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 SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

688 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