Solved

What is the most reliable way to export from SQL Server as CSV Quote Comma delimited file format?

Posted on 2015-01-08
3
135 Views
1 Endorsement
Last Modified: 2015-01-14
Of the various methods to export data from SQL server in quote comma delimited format, which method(s) are most reliable and what settings in SSMS or the Import/Export tool, if any, are required?
1
Comment
Question by:bobinorlando
[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 Comments
 
LVL 66

Expert Comment

by:Jim Horn
ID: 40538670
Define 'quote comma delimeted format' and 'reliable'.
I've never had a problem with SSIS packages exporting to csv.
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 40538748
I've had some issues with commas being the delimiter, since so commas can appear frequently in data.  I personally prefer tildes (~~) delimited or pipes (||) (pipes is not an issue with SQL Server, but might be with Oracle since || is an operator there).
0
 
LVL 43

Accepted Solution

by:
Eugene Z earned 500 total points
ID: 40539241
..it depends... you need to provide more details...

The simplest way to copy data from a database table to file is to use the basic BCP command:

BCP yourdb.dbo.yourtableforExport out c:\result.svc-c -t, -T –S<servername
more:BCP
http://msdn.microsoft.com/en-us/library/ms162802(v=sql.100).aspx
--

you can save output from you select in SSMS as csv

-
you can use PowerShell
--
SSIS import\export
--
C#
--
more examples
Saving SQL Query Results to Comma Delimited Files (CSV)

http://www.virtualobjectives.com.au/sqlserver/saving_to_csv.htm
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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 to return specific rows and columns, with various degrees of sorting and limits in place.

630 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