1

This SSMS newbie is trying to print the results of a query instead of having it directed to the grid I followed the following steps:

Management Studio -->> Tools -->>Options -->>

Query Results -->>General -->> Results to text and c:\works as Default location for saving query

Query Results -->>SQL Server -->> Results to text -->>Include column headers when copying or saving...

yet, when query is executed, I don't see the results at all could someone please shed the light my way as to how can I get the query results saved to a file that I can print later on?

3 Answers 3

1

If you send the results direct to file, you can't see them in the Results pane in SSMS.

You have three choices:

  • Results to Text (plain text, in the Results pane)
  • Results to Grid (grid view, with resizeable columns & rows similar to Excel)
  • Results to File (writes direct to file, results not displayed)

You can choose between these options from the Query -> Results menu, buttons on the Standard toolbar, or keyboard shortcuts (CTRL-T,CTRL-D, CTRL-SHIFT-F, in the order above). Select your output "mode", then execute the query.

With the first two options, you can right-click the results and save to a file from there. Or copy/paste elsewhere.

With Results to File, it will output the results in a file in your default location (c:\works\ in your case) but it should prompt you with the standard Windows File Save dialog.

0

You need to select "Results to File" not "Results to Text". When you then go back and run your query, you will not see any query results, just a prompt for the file name you want to save the results as.

0

You don't want Results to Text. You want Results to File. Then, when you execute the query, you'll be prompted for the file name to save under.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.