MSSQL Export A Table Data To CSV
Posted by in SQL Server March 17, 2011 Leave a comment

Actually, it is a trick in Microsoft SQL Server Management (or Studio Express) not like mysqldump tool in mysql but it works. Steps below will show you how to export data of a table to a CSV file in Microsoft SQL Server.

1. In Microsoft SQL Server Management, choose a database, right-click on that and then select “New Query”

mssql-select-database

mssql-select-database

2. Type a sql command to get your data which you want to export, something like this:

select * from Person.Contact

3. Right-click at the result panel and select “Save Results As…

mssql-export-data-to-csv

mssql-export-data-to-csv

4. Name the file with .csv extension, ex: result.csv

That’s all. You got it!

Hoan Huynh is the founder and head of 4rapiddev.com. Reach him at hoan@4rapiddev.com