how to make unique constraint in sql code example
Example 1: unique constraint mssql
USE AdventureWorks2012;
GO
CREATE TABLE Production.TransactionHistoryArchive4
(
TransactionID int NOT NULL,
CONSTRAINT AK_TransactionID UNIQUE(TransactionID)
);
GO
Example 2: unique key in sql
Unique Key:
Only unique value and also can contain NULL