# SQL Key Definition Update Options

> Source: https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/sql-key-definition

The

**SQL Key Definition Update** utility is used to set an update option for the SQL Key Definition file *providex.kdf*. The update option determines how or if the *providex.kdf* file will be automatically updated when the PxPlus Data Dictionary key definition is changed. To edit the PxPlus Data Dictionary key definition, see **[Defining Keys](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/defining-keys)**.

To invoke this utility, select *SQL Key Definition Update* from the *Options* menu in **Data Dictionary Maintenance**:

![](https://manual.pvxplus.com/migration-assets/5cd5dea5358a7bb14483c45603ee038791d60eed56934ea97cd811facbb3eaf5.png)

This window consists of the following:

|  |  |  |
| --- | --- | --- |
|  | *If Record Exists* | The *providex.kdf* file will only be updated with the PxPlus Data Dictionary key definition if a record already exists in the *providex.kdf* file. ***(Default)*** |
|  | *Always* | Always update the *providex.kdf* file. |
|  | *Manually* | Never updates the *providex.kdf* with the PxPlus Data Dictionary key definition. To manually update the *providex.kdf* file, see **[SQL Key Definition](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/sql-key-definition#sqlkeydef)**. |

The update option will be saved in the *nomads.ini* file or a project settings file under the section \[Data Dictionary Options\]:

SQL Keys Update = *update option value*

***Where:***

*update option value* can be:

|  |  |
| --- | --- |
| 1 | If record exists |
| 2 | Always |
| 3 | Manually |

## SQL Key Definition

The **SQL Key Definition** window is used to create or remove an SQL key definition for the selected table.

To invoke, select the *SQL Keydef* tool bar button in **Data Dictionary Maintenance**:

![](https://manual.pvxplus.com/migration-assets/d9974f4d0a7b8a7836e21096fee808f7c9a3d3f00b3301a2a1d473e779fe7962.jpg)

The external database key definition for the selected table will be automatically displayed. The *Delete* button will be disabled if the record does not exist in the *providex.kdf* file.

## Key Definition Mismatch

If **SQL Key Definition Update** is set to *Manually* and the **SQL Key Definition** record does not match the PxPlus key definition, selecting the *SQL Keydef* button brings up the **SQL Key Definition** window with the following message:

*Mismatch between the PxPlus DD key definition and the SQL key definition. Press the 'Re-Sync' button to load from the PxPlus definition.*
