Writing a Query

The primary tool that facilitates the development of SQL statements is the query/view designer, which is a graphical tool that enables you to build queries with a point-and-click interface. After a query is written, this tool enables you to execute that query, view the returned results, and even perform basic troubleshooting by examining the query execution plan.

Creating a new select query against a table is as simple as right-clicking the database in Server Explorer and then selecting New Query. An initial prompt gathers a list of the tables, views, functions, and synonyms to use as the target of the query (see Figure 13.13).

FIGURE 13.13 Adding tables to the query.

Tip

The visual query design tools we are discussing are, ...

Get Microsoft Visual Studio 2015 Unleashed, Third Edition 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.