Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Export data into CSV using query
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Syamsul Izwani
Starting Member

1 Posts

Posted - 09/22/2012 :  05:07:28  Show Profile  Reply with Quote
How to export data from table into csv file just using query?
I want to download the data using CSV file did anyone know how to do this????


Flowing Fount of Yak Knowledge

5155 Posts

Posted - 09/22/2012 :  08:49:16  Show Profile  Reply with Quote
You can use bcp - there are examples on this MSDN page:

BCP is a command that you run from a command line on the OS. To run it as a query, you will need to use xp_cmdshell:
Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 09/22/2012 :  12:51:58  Show Profile  Reply with Quote
make sure xp_cmdshell is enabled in server before you use it. By default xp_cmdshell will be disabled and you've run sp_configure to enable it


SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000