Create or edit views in Database Model diagrams

You can think of a view as a saved query. Views are particularly useful if you want to access the same information from multiple tables or expose data to users without letting the users change the actual tables.

It is most likely that your edition of Microsoft Office Visio doesn't include the features you are looking for. To find out which edition of Visio you have, click About Microsoft Office Visio on the Help menu. The name of the edition is in the top line of text in the dialog box.

Microsoft Office Visio Standard does not include the Database Model Diagram template.

Microsoft Office Visio Professional supports the reverse engineering features for the Database Model Diagram template (that is, using an existing database to create a model in Visio) but it does not support forward engineering (that is, using a Visio database model to generate SQL code).

Note: You can find the full suite of database modeling features, including both reverse engineering and forward engineering, in Visio for Enterprise Architects. Visio for Enterprise Architects is included in MSDN Premium Subscription, which is available with Visual Studio Professional and Visual Studio Team System role-based editions.

Add a view to a database model diagram

From the Entity Relationship or Object Relational stencil, drag a View shape onto the drawing page.

Assign columns from tables to a view

Open the database model diagram that contains the view you want to add columns to.

Double-click the view, and then in the Database Properties window, in the Categories list, click Columns.

Do one of the following:

Click the Physical Name field of a blank line and type the name of the column. Repeat for each column you want to add to the view.

Click Add. The default name for the new column follows the naming conventions you specified in the Modeling Preferences dialog box. To change the name of the column, click the default column name and type a new name. Repeat for each column you want to add to the view.

Click the name of the column whose properties you want to define, and then click Edit.

In the View Column Properties dialog box, on the Source tab, click Known column in another table or view, and then click Change.

In the Pick A Column dialog box, select a column from the list of tables and views in your database model diagram, and then click OK.

Remove a view

On the drawing page, click the view you want to remove, and then press DELETE.

In the Delete Object dialog box, do one of the following:

Click Yes to remove the view from the drawing page, as well as from the model and the Tables and Views window.

Click No to remove the view from the drawing page, but not from the model or the Tables and Views window.

Note: If you do not see the Delete Object dialog box when you delete an object from the diagram, on the Database menu, point to Options, click Modeling, and then on the Logical Diagram tab in the Database Modeling Preferences dialog box under When removing an object from the diagram, click Ask User What To Do. Alternatively, if you want to remove the view from the model, click the view in the Tables and Views window, and then press the DELETE key.