How to create a view (Enterprise Manager)
To create a view
- Expand a server group; then expand a server.
- Expand Databases; then expand the database in which to create the view.
- Right-click Views; then click New View....
- Right-click in the diagram pane; then click Add Table....
- On the Tables or Views tabs, click the table or view to add to the new view, and then click Add. Repeat for each table or view you want to add to the new view.
- In the Column box of the grid pane, select the columns to be referenced in the view.
- Select Output if the column is to appear in the result set of the view.
- To group by column, right-click the column, and then click Group By.
- In the Criteria column, enter the criteria specifying which rows to retrieve; this determines the WHERE clause. If Group By is specified, this determines the HAVING clause.
- In the Or column, enter any additional criteria to specify which rows to retrieve.
- Right-click anywhere in the grid pane; then click Properties.
- Optionally, select:
- Output all columns to display all columns in the view in the result set.
- DISTINCT values to filter out duplicate values in the result set.
- Encrypt view to encrypt the definition of the view.
- Optionally, in Top, enter the number of rows to return in the result set. Enter the word PERCENT after the number to return a percentage of rows in the result set.
- Right-click anywhere in the diagram pane; then click Run (to view the result set) or Save (to save the view).
See Also
Creating a View
(c) 1988-98 Microsoft Corporation. All Rights Reserved.