MS SQL Server 2012 - DBA Articles |
Unique IndexSQL Server implicitly creates a unique Nonclustered Index, when creates table with Unique constraint. The index column(s) are equal to constraint column(s) and the index name is equal to constraint name. Explicitly, we can create more than one Unique Index, when the table structure does not have a Unique constraint. The following example describes to create a Unique Index on Department table. This index helps to maintain unique data values. --
Example 150 -- USE EBusiness GO
--
Create Unique Index on Department Table -- CREATE UNIQUE INDEX IX_Department_Unique
ON dbo.Department (Dept_Name) GO |
* * * * *