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

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?
LVL 1
bobinorlandoAsked:
Who is Participating?
 
Eugene ZCommented:
..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
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Define 'quote comma delimeted format' and 'reliable'.
I've never had a problem with SSIS packages exporting to csv.
0
 
Scott PletcherSenior DBACommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.