274
Part II: Building Databases and Working with Data
The Basic View
Using SQL Server Management Studio, views may be created, modifi ed, executed, and
included within other queries, using either the Query Designer or the DDL code within the
Query Editor.
Creating Views Using the Query Designer
Because a view is nothing more than a saved T-SQL SELECT statement, the creation of a
view begins with a working SELECT statement. Any SELECT statement, as long as it’s a
valid SELECT statement (with a few minor exceptions), can be cut and pasted from nearly
any other tool into the view designer.
Within SQL Server Management Studio, views are listed in their own node under each
database.
The New View command in the context menu launches the Query Designer in a mode that
creates views, as shown in Figure 11-1.
FIGURE 11-1
Creating a view in Management Studio’s Query Designer.
The View Designer mode functions within Management Studio’s Query Designer, which is
also used to query tables. You can display or edit the actual T-SQL code for the view in the
c11.indd 274c11.indd 274 7/30/2012 4:41:08 PM7/30/2012 4:41:08 PM
http://www.it-ebooks.info