ערוך

שתף באמצעות


Unique Property

Version: Available or changed with runtime version 3.0.

Sets a value that indicates whether a SQL Server unique constraint that corresponds to the key should be created.

Applies to

  • Table key

Note

The Unique property cannot be used in table extension objects.

Property Value

true if the key value must be unique; otherwise, false. The default is false.

Remarks

A unique index ensures that records in a table do not have identical field values. With a unique index, when a table is validated, values of the field that makes up the key are checked for uniqueness. If the table includes records with duplicate values for the field, the validation fails.

Example

The following example defines a primary key and two unique secondary keys.

keys
{
    key(PrimaryKey; ID)
    {

    }
    key(CustomerInfo; Name,Address,City)
    {
        Unique = true;
    }
   key(Email; Email)
    {    
        Unique = true;
    }
}

Table Keys