A non-unique index allows duplicates to be inserted where a duplicate is defined as having the exact same values across each of the columns in the index. A unique index will raise an error and rollback an insert or update transaction when this check is failed.
If the CREATE INDEX query does not include the CLUSTERED or NONCLUSTERED key words, then the index will be a NONCLUSTERED index by default.
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
Ah sorry I misread your OP and missed the part about IGNORE_DUPLICATE_KEY. Note that this option cannot be set to ON for a non-unique index, so it really only applies to unique indexes. When this option is ON, only a warning will be generated but the insert or update containing a duplicate will be allowed. When OFF (which is the default), the error is raised and the transaction is rolled back as I described earlier.
For an index on columns A, B and C that is unique, rows are considered duplicates if row1.A = row2.A AND row1.B = row2.B AND row1.C = row2.C. Note that this doesn't mean that column A = column B = column C, just that the values in the two rows match.
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200