1ALTER TABLE table_name ADD CONSTRAINT cst_name UNIQUE (col_name);
2ALTER TABLE table_name ADD CONSTRAINT cst_name UNIQUE (col1, col2); -- Multiple
3ALTER TABLE table_name ADD col_name NUMBER UNIQUE; -- New field
1USE AdventureWorks2012;
2GO
3CREATE TABLE Production.TransactionHistoryArchive4
4 (
5 TransactionID int NOT NULL,
6 CONSTRAINT AK_TransactionID UNIQUE(TransactionID)
7);
8GO
9
10