Adding primary key
To add a primary key:
Procedure
- Log on to the MXDM.
-
In the Navigation tree pane, click
Database.
MXDM displays a list of available systems in My Systems.
-
Expand a selected system in the navigation tree.
List of catalogs for the selected system appears.
-
Click and expand the contents of a Catalog.
The list of schemas appears.
-
Expand a schema in the left pane.
The Tables folder appears.
- Expand the Tables folder and select a table in the left pane.
- Right-click the table and select Alter Table from the context menu.
-
Select
Add Primary Key.
Add Primary Key dialog appears.
- Select Let SQL/MX choose the name to generate the primary key constraint name automatically, else explicitly provide a primary key constraint name in the Name field.
-
Select columns from the
Columns Available grid and click
Add to move them to the
Columns in Primary Key grid.
NOTE:
-
At any point of time use Move Up or Move Down to change the order of the selected columns in the Columns in Primary Key grid.
-
The Add Primary Key context menu is disabled if the table already contains a primary key.
-
- Click OK to add primary key to the table.