Online Documentation for SQL Manager for DB2

Primary/Unique keys


A Primary key constraint designates a column as the Primary key of a table. A composite primary key designates a combination of columns as the primary key.

 

Table keys are managed within the Constraints tab of Table Editor.

 

 

Creating Keys

 

To create a new key:

  • open the table in Table Editor;
  • proceed to the Constraints tab, and then to the Primary/Unique Key tab there;
  • right-click the tab area and select the New Primary/Unique context menu item;
  • define the key properties using the Primary/Unique Key Editor dialog.

 

Viewing Keys

 

To view an existing key:

  • open the table in Table Editor;
  • proceed to the Constraints tab, and then to the Primary/Unique Key tab there;
  • right-click the key and select the View Primary/Unique Key context menu item, or simply double-click the key;
  • view the key properties using the Primary/Unique Key Editor dialog.

 

Dropping Keys

 

To drop a key:

  • open the table in Table Editor;
  • proceed to the Constraints tab, and then to the Primary/Unique Key tab there;
  • right-click the key and select the Drop Primary/Unique Key context menu item;
  • confirm dropping in the dialog window.