Russ' Do It Yourself Home Workshop

Finding Fixes to Just About Anything and Everything

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.

image

By right-clicking on the query design surface you can choose to send the results to a file.

image

You should be prompted to specify a file to save to when the query is executed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: