alter table unique code example
Example 1: mysql alter table set column unique
ALTER TABLE contacts
ADD CONSTRAINT contacts_unique UNIQUE (reference_number);
Example 2: unique constraint mssql
USE AdventureWorks2012;
GO
CREATE TABLE Production.TransactionHistoryArchive4
(
TransactionID int NOT NULL,
CONSTRAINT AK_TransactionID UNIQUE(TransactionID)
);
GO