Is the Sql Server Unique Key also an Index?

Unique Key: Unique Key enforces
uniqueness of the column on which they
are defined. Unique Key creates a
non-clustered index on the column.
Unique Key allows only one NULL Value.

Alter table to add unique constraint
to column:

ALTER TABLE Authors ADD CONSTRAINT
IX_Authors_Name UNIQUE(Name) GO

Source

More information from MSDN.

FWIW — if your constraint doesn’t create an index, I would avoid naming it IX_ as that would typically be assumed to be associated with one (IX = Index).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)