III.4.2. Selecting Results Formatting Options

Outputs of queries can be displayed or saved directly to a file. Right-click the query window, select Results To, and select one of the following options:

  • Results to Text: Displays results in a text format. The format of the text output can be modified by right-clicking the query window, selecting Query Options | Results | Text.

  • Results to Grid: Displays in a grid format (the default). The format of the grid output can be modified by right clicking in the query window, selecting Query Options | Results | Grid.

  • Results to File: Saves directly to a file. Files are saved in a report file (RPT) format that can be opened by a text editor.

Whether the output is sent to a grid or text format, you have several options available in the Grid and Text settings of the Query Options dialog box. Unlike the Execution options, which affect how the query runs, the Results options affect only how the results are displayed.

The following steps demonstrate how to modify the query output:

  1. Launch SQL Server Management Studio (SSMS) by choosing StartAll ProgramsMicrosoft SQL Server 2008SQL Server Management Studio.

  2. Click the New Query button to open a new query window ...

Get Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.