How to Get a CSV File Generated from a SQL Server Query (SQL 2008)
Posted by Russell Wright on August 21, 2012
In SSMS (SQL Server Management Studio) you are running a query and want to get a CSV file as the results. This is accomplished by setting the Output format in the Query Options to Comma delimited. You can also determine whether to include the column headers in the results.
By right-clicking on the query design surface you can choose to send the results to a file.
You should be prompted to specify a file to save to when the query is executed.