The Keys folder in my table lists the Primary and Foreign keys.There is one other key. What is it?

The Keys folder in my table lists the Primary and Foreign keys.

There is one other key. What is it?

Here is a screen shot
keys-folder.png
Mr_ShawAsked:
Who is Participating?
 
santoshmotwaniConnect With a Mentor Commented:
1 down vote accepted
      

A UNIQUE constraint is also known as a UNIQUE KEY constraint. Basically, there can be multiple KEYs for a table. One is selected (somewhat arbitrarily) to be the PRIMARY KEY for the table. Other keys are created as UNIQUE KEY constraints.

As an implementation detail, a UNIQUE KEY constraint is implemented by placing a UNIQUE index on the same columns in the table. However, it is possible to create UNIQUE indexes on a table (via CREATE INDEX), without creating a UNIQUE constraint.

UNIQUE constraints are similar to PRIMARY KEYs - they can be the target reference for a FOREIGN KEY constraint. A UNIQUE index, by itself, cannot be so referenced.

In SSMS, PRIMARY KEY, UNIQUE, and FOREIGN KEY constraints will always show up under the "Keys" folder for a table. CHECK and DEFAULT constraints will show up under the "Constraints" folder


ref: http://stackoverflow.com/questions/3978680/constraint-is-key-is-index-is-constraint
0
 
santoshmotwaniCommented:
0
 
Mr_ShawAuthor Commented:
Why is this not in the constraints folder?
0
 
Mr_ShawAuthor Commented:
thanks
0
All Courses

From novice to tech pro — start learning today.