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
130 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 65

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

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…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

739 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