SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Export data into CSV using query
 New Topic  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: http://msdn.microsoft.com/en-us/library/ms162802.aspx

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: http://msdn.microsoft.com/en-us/library/ms175046.aspx
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  
 New 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.06 seconds. Powered By: Snitz Forums 2000