Try OpenEdge Now
skip to main content
DataServer for Microsoft SQL Server
The DataServer Tutorial : Managing server attributes : Defining a primary key constraint definition
 

Defining a primary key constraint definition

The following procedure describes how to define a primary key constraint definition.
To define a primary key constraint definition:
1. Start Data Administration and connect to the OpenEdge database you are migrating.
2. Select DataServer > MS SQL Server Utilities > Server Attributes > View/Maintain Foreign Constraints.
The View/Maintain Foreign Constraint Definitions dialog box appears.
3. Select the table for which you are defining a primary key constraint definition and click Create Constraints.
The Create Foreign Constraint Definitions for tablename dialog box appears, as shown in the following figure.
Figure 18. Create Foreign Constraint Definitions for tablename dialog box
4. Accept the default constraint definition name, or enter a new one.
5. Select an index for the primary key constraint definition. Only indexes with an I in the All Columns Mandatory column are recommended for the primary key constraint definition. As long a column is unique, you can select as the primary constraint. Note, however, that the columns designated as the primary constraint are migrated as NOT NULL capable. That is, if you store many records in your OpenEdge database with the unknown value, they cannot be migrated to the foreign data source, given the defined primary constraint on that server object.
6. By default, the primary key constraint definition has the Active check box selected. Leave this box selected if you want the constraint definition you are defining to be available for migration.
7. For the DataServer for MS SQL Server, if no clustered index constraint definition is currently defined, the Clustered check box is selected. Leave selected if you want the clustered index constraint definition to also be applied to the index you are selecting for the primary key constraint definition.
Note: Progress Software Corporation recommends defining primary and clustered constraint definitions for the same index whenever possible.
8. Optionally, add a description of the constraint definition in the Description box.
9. Click OK to save the constraint definition and exit the dialog box.
10. Click Create to save the constraint definition and remain in the dialog box and continue defining constraint definitions for the selected table.
If the primary constraint definition is incorrectly defined, a message is displayed and the constraint definition is not created.
The system fails to generate a constraint definition when an index is not defined as unique by the presence of either an OpenEdge unique attribute (indicated by an I) or by a unique constraint definition (indicated by a C) in the Unique column.