Good question? Are you doing this from an application development perspective or running it from query analyzer. If it is from query analyzer you can just save the results of your query as a csv or txt file when you run the query (click in the results pane and click File, Save).
From an application development point of view use the client (which could be vb, c or some program) to control output.