Working with Database Views in Data View

A view is a virtual table whose contents are defined by a pre-compiled query that is stored and maintained on the database server. A view looks like a real table, with a set of named columns and rows of data. However, a view does not exist as a stored set of data values in a database. Instead, it is a query result set that is maintained on the server and updated each time you open the view. You can use a view to extract and combine just the information you need from one or more existing tables.

Views can be created in most ODBC-compliant databases. The data that you view is stored in the database tables. You can open a view and modify the data that appears inside it. When you modify the data you see in a view, you are actually changing data in the underlying database tables. Changes to data in those tables are automatically reflected in the views derived from them.

For Microsoft® SQL Server™ databases, views are created, edited, and deleted in Microsoft SQL Enterprise Manager. For more information about creating and managing views, see "Creating Views" in SQL Server Books Online. You can also create a view using the View Designer, a tool available with the Microsoft® Visual Database Tools. For details, see Creating Views with the View Designer.

You can use Data View to open, design, edit, and delete views in your database. For each data connection, Data View displays any views in the database associated with the data connection. You can expand the Views folder to see the columns in the views.

Double-clicking a view icon in Data View opens the view and displays its data, which you can edit. You can also use the View Designer to modify a view's definition. The View Designer looks just like the Query Designer, but it creates a view rather than a query when you save your definition.

To work with database views in Data View

  1. Expand the Views folder to select the view you want to work with, or create a new view by right-clicking the Views folder and choosing New View from the shortcut menu.

  2. Right-click the view and choose one of the following options.
    To Choose
    Open the selected view to display the data in the view as a table, where you can edit it Open
    Modify the selected view in the View Designer Design
    Create a new view

    Note   In Microsoft® Visual C++®, you can also create a new view using the New Database Item command on the Insert menu

    New View
    Remove the selected view from Data View and delete it from the database Delete

For more information about views, see Creating Views with the View Designer. For more information about creating queries, see Query Designer.