Previous Page
Next Page

1.14. Displaying the Results

Results in SQL Server are displayed in the Results pane. The Results pane is shown in Figure 1-25. SQL queries can be executed to view results in grid form or text form, or the results can be saved to a file, as discussed in the following subsections.

1.14.1. Viewing Results in Grid Form

The grid form displays the results in spreadsheet-like grids. To execute a query and view query results in grid form, first click the "Results to grid" icon (this icon is shown in Figure 1-26) and then click the Execute button.

Figure 1-26. Displaying the results icons


You may also click <F5> on the keyboard to execute queries.


You will now get the results in grid form, as shown in Figure 1-27.

On Figure 1-27, on the bottom panel of the screen, the name of the database and the number of rows in the result set are displayed.

Figure 1-27. Viewing results in grid form


1.14.2. Viewing Results in Text Form

To execute a query and view query results in text form, click on the "Results to text" icon (shown in Figure 1-26) and then click the Execute button. You will now get the results in text form, as shown in Figure 1-25. Viewing the output in text form may make it easier for you to copy and paste the output into a word processor, from where you can print the output easily. Figure 1-25 also displays, on the bottom panel of the screen, the name of the database and the number of rows in the result set.

1.14.3. Saving Results to File

To save your query results to a file, from Figure 1-26, select Results to File icon (this icon is shown in Figure 1-26), and then click the Execute button. The Save Results window will come up and you will be able to select the appropriate directory and enter the appropriate filename and save the results to file for later use. The Results to File option produces output formatted for Crystal Reports. Crystal Reports is the best-selling database reporting tool and is included with SQL Server. It is beyond our scope to discuss Crystal Reports here.

To open this Crystal Report (the saved file), select File from the top menu, Open, and then File (as shown in Figure 1-28). Then, navigate to the directory where you saved your file, select your file, and your results will be displayed on the screen.

Figure 1-28. Opening Crystal Reports



Previous Page
Next Page