check constraint prevents duplicate values in a table
snippet in c

check constraint prevents duplicate values in a table

user6097

CREATE TABLE sampleTable (   col1            int         NOT NULL,   col2            varchar(10) NOT NULL,   nonUniqueColumn varchar(5)  NULL,   CONSTRAINT UC_nameOfConstraint UNIQUE (contestID,keyName) ); 

check constraint prevents duplicate values in a table

user4457

CONSTRAINT UC_nameOfConstraint UNIQUE (column1,column2)