Share via


Creating Indexed Views

An indexed view is a view whose result set is stored in the database for fast access.  For more background on indexed views, see Indexed Views.

To create an indexed view

  1. In the SQL Server Enterprise Manager, make sure the Databases node is expanded, and that the node for the target database is expanded, too.

  2. Right-click on the Views node, then choose New View from the shortcut menu.

  3. Add tables to the Diagram pane.  Because you intend this to be an indexed view, be sure to add only tables that you own.

  4. Select which columns you want included in the view.  Do not use the asterisk (*); you must explicitly select each column that you want to appear in the indexed view.

  5. Right-click the background of the Diagram pane, then choose Manage Indexes from the shortcut menu.  The Indexes dialog box appears.

    Note   There are many situations in which the Manage Indexes command is unavailable, because there are many restrictions on which views can be indexed.  For example, you cannot index a view unless you are the owner of each table contributing to it. For more information about indexed views, see View Indexes.

  6. Within the dialog box, click New.

  7. Supply the information for the index definition — index name, index columns and their order, index file group, and the other index settings.  For a complete description of these settings, see Indexes Dialog Box.

  8. Click OK.

See Also

Indexed Views | Modifying Indexed Views | Creating Views