What is the difference between Unique Key and Index with IsUnique=Yes?

后端 未结 6 1465
别那么骄傲
别那么骄傲 2021-02-04 23:45

I have a table with a primary key, but I want two other columns to be constrained so the combination of the two is guaranteed always to be unique.

(a dumb example: In a

6条回答
  •  别那么骄傲
    2021-02-05 00:20

    Just so that you know, when you create a unique constraint SQL Server will create an index behind the scenes

提交回复
热议问题