Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
140 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
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 70

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 2000 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

885 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