III.8.2. Creating a View

Views can be created in two ways:

  • View Designer: The graphical interface available in SQL Server Management Studio (SSMS) allows you to create views rather easily with a point-and-click interface.

  • Transact-SQL: If you created a query and then want to convert it into a reusable view, you can do so with a couple extra lines of code.

III.8.2.1. Creating a view with the View Designer

The View Designer is a valuable tool included within the SQL Server Management Studio (SSMS). With View Designer you can easily create sophisticated views against one or many tables in your database.

III.8.2.1.1. Exploring the View Designer

Follow these steps to open the View Designer:

  1. Launch SQL Server Management Studio (SSMS).

    Choose StartAll ProgramsMicrosoft SQL Server 2008SQL Server Management Studio.

  2. On the Connect to Server screen, click Connect.

  3. Using the SSMS Object Explorer, browse to the Databases | AdventureWorks2008 | Views container.

  4. Right-click the Views container and choose New View.

    The View Designer appears with the Add Table dialog box on top.

  5. Select any table and click Add. Click Close.

    The View Designer, shown in Figure 8-3, is now fully visible. The View Designer has ...

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.