Unique Constraints are similar to primary key constraints except we could have multiple unique constraints in any given table and one NULL value in the column that has unique constraint. Both primary key constraint and unique constraint create unique index.
To create a unique key constraint on a new table
CREATE TABLE table1
(
col1 INT,
col2 VARCHAR(20),
CONSTRAINT uq_col1 UNIQUE (col1)
);
go
To add unique key constraint on existing table
ALTER TABLE table1
ADD CONSTRAINT uq_col1 UNIQUE (col1);
go
To see our constraint is created properly we could check as
SELECT *
FROM sys.key_constraints
WHERE type = ‘UQ’
AND name = ‘uq_col1’;
If you check on SSMS creating a unique key constraint does automatically creates a unique index.
Read More
http://technet.microsoft.com/en-us/library/ms190024.aspx