SQL Server 2005: Return a Comma Delimited Result Set from Queries

Posted January 24, 2007 by Rob Rogers in Database

One almost always runs into a situation that requires a comma delimited result set from a query so that the data can be utilized by other software. Luckily, this is a native feature in the Query Editor.


1. Open SQL Server 2005 Management Studio.

2. Click Tools and select Options.

3. In the Options dialog box, double-click on Query Results in the left pane.

4. Select Results to Text in the left pane.

5. From the Output format dropdown, select Comma delimited.

6. Click OK.

7. Click OK on the resulting confirmation box telling you that the changes will only be applied to new SQL Server Query Editor window.

Now open a new Query Editor window and execute a query to make sure the results are as desired.

 

About Rob Rogers

Once a prolific author here on Tech-Recipes, Rob has moved on to greener pastures.
View more articles by Rob Rogers

The Conversation

Follow the reactions below and share your own thoughts.