Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 143
  • Last Modified:

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?
1
bobinorlando
Asked:
bobinorlando
1 Solution
 
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
 
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now