A rule preventing repeated values in a column, or combination of columns, other than the primary key; a unique index enforces it. A single NULL is permitted, which a primary key does not allow.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains UNIQUE constraint in context, with comparison tables and the common traps.
Terms in this definition
- VALUES
Returns in DAX the distinct column values, or table rows, still visible after filters are applied, sometimes with an extra blank entry. CALCULATE often takes the result as a table filter.
- Primary key
Uniquely identifies every row in a relational table, using one column or several together. A foreign key in another table holds this value to reference the row.
- Unique index
An index ensuring that no key value appears in more than one row, which also helps the optimiser. Declaring a UNIQUE constraint builds one for you.
- NULL
Marks that a row has nothing in a particular column, as when a person has no middle name. Columns defined NOT NULL can never be left empty.
Related terms
- HASHBYTES
Hashes its input with an algorithm like SHA2_512 or SHA2_256 and gives back varbinary(8000). Storing that in a persisted column lets a unique constraint cover a value too large to index directly.