UNIQUE - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

An unnamed UNIQUE constraint on a single column or a composite UNIQUE constraint on multiple columns of the table. A UNIQUE constraint enforces the rule that no two rows in the table can have the same value in a column set. 
Columns must be defined as NOT NULL.
Any system-defined secondary or single-table join indexes used for this constraint are included in the maximum of 32 secondary, hash, and join indexes per table. This includes the system-defined secondary indexes used to implement UNIQUE constraints for nontemporal tables and the single-table join indexes used for UNIQUE constraints on temporal tables.
A UNIQUE constraint is a unique secondary index for nontemporal tables and a single-table join index for most temporal tables.
UNIQUE constraints ensure the uniqueness of alternate keys. Columns with UNIQUE constraints can be used to create referential integrity relationships with other tables. For details about UNIQUE constraints on temporal tables, see Teradata Vantage™ - ANSI Temporal Table Support , B035-1186 and Teradata Vantage™ - Temporal Table Support , B035-1182 .
You cannot specify UNIQUE constraints on columns with the following data types.

  • BLOB
  • CLOB
  • ARRAY
  • VARRAY
  • Period
  • XML
  • Geospatial
  • JSON
  • DATASET

If the current data violates the uniqueness constraint, the system returns an error to the requestor and the table is not changed.

CONSTRAINT constraint_name
A named UNIQUE column constraint.