Changing a Table View in a Database Diagram
When you are working with only a few tables in a database diagram, it is usually helpful to view as much column information as possible. Such a view not only gives you more information, but it also enables you to edit the column definitions.
When you are working with a large number of tables, however, it is usually preferable to view only the column names, or only the table name, so that you can see more of the tables in your diagram at once.
In a database diagram, you can expand the tables you want to edit as needed and then collapse them again to save space on the diagram.
Each table in a database diagram can be displayed in one of five views.
Standard Shows every database column of the table, but shows only the column name and other fundamental properties of each database column. You can edit the column properties directly by typing in a cell or using the Cut, Copy, and Paste commands. You can also move and delete entire database column definitions.
When you insert a new table into a diagram, it is shown in this view so that you can begin defining each column.
Column Names Shows only the name of each database column. You can rename the database columns in this view. When you add an existing table to a diagram, it is shown in this view.
Keys Shows only the names of only some of the table's columns. The columns whose names appear are those participating in a primary key, a foreign key, or a unique constraint. You can rename some of the database columns in this view.
Name Only Shows only the table name.
Custom Shows all of the table's database columns, but shows only the properties you choose. This gives you the flexibility to display only the information you want. This view is also useful for printing the database diagrams, because you can display more tables on one page, and will not normally see horizontal scroll bars on the tables.
The default set of properties for the Custom view includes Column Name, Condensed Datatype, and Nullable.
Property | Setting |
---|---|
Column Name | The name of the field in the table. |
Condensed Datatype | Information about the field's data type, in the same format as the SQL Create Table statement. For example, a field containing a variable-length string with a maximum length of 20 characters would be represented as varchar(20) . |
Nullable | Null (the field can contain a Null value) or Not Null (the field must contain a non-null value). |
To change a table view
- In your database diagram, select the tables you want to see in another view. To change the view of all the tables, right-click in the diagram and choose Select All.
- Right-click the table and select the desired view from the shortcut menu.
When you finish editing a table, you can change it to a different view or resize it to create more space on the diagram.
To modify the Custom view
- In your database diagram, right-click the table you want to see in Custom view.
- From the shortcut menu, choose Table View... then Modify Custom View. The Column Selection dialog box appears.
- Use the arrows to move the desired columns from the Available columns box to the Selected columns box.
Note To add a column, highlight the column in the Available columns box and click the > button. The column will then be listed in the Selected columns box. To display all columns, click the >> button. To remove a column from the Selected columns box, highlight the column and click the < button.
- The columns will appear in the table in the order they are displayed in the Selected columns box. Use the Sort arrows to rearrange the columns in the Selected columns box to the desired order.
- To make this setting the default Custom view, select the Save as default box.
Note If the Save as default box is not selected, the columns listed in the Selected columns box will be displayed for all the database tables displayed in Custom view on the current diagram. However, this setting will not be saved and is not applied to other diagrams when you choose the Custom view command.
- Click OK.
The selected table is redrawn to display the columns chosen in the dialog box.