Consider this unique constraint:
ALTER TABLE Posts
ADD CONSTRAINT UQ_Posts_Name
UNIQUE (Name);
Does it automatically create index on Name
column?
Consider this unique constraint:
ALTER TABLE Posts
ADD CONSTRAINT UQ_Posts_Name
UNIQUE (Name);
Does it automatically create index on Name
column?
You can create a separate index on it as well. this article http://msdn.microsoft.com/en-us/library/aa224827(SQL.80).aspx describes the differences very well.
Yes, just to add.. creating primary key automatically creates clustered index.
EDIT: I was wrong... after Lieven's comment:
When you create a PRIMARY KEY constraint, a unique clustered index on the column or columns is automatically created if a clustered index on the table does not already exist and you do not specify a unique nonclustered index. The primary key column cannot allow NULL values.