Link to home
Start Free TrialLog in
Avatar of SeTech
SeTechFlag for United States of America

asked on

Exporting data from SQL to CSV file

I have a table in SQL Server 2008 and would like to export it to a csv file. Although I do not know it, there must be some sort of code or script that can be written to accomplish that work and that is what I am looking for. Thanks
Avatar of Mr Knackered
Mr Knackered
Flag of United Kingdom of Great Britain and Northern Ireland image

If this is a one off exercise you can use the Export Data functionality within SQL Management Studio. Right click on the database , Tasks, Export Data and export it to Excel or a Flat File. I am using SQL 2014 but think this facility was available in SQL 2008 as well.
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If it is only one time issue and you want to do it quickly then just run the select statement from your table and then in the result grid right click on the left upper corner and choose "Save result as", give a name and location and click Save:
User generated image