Solved

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

Posted on 2011-02-25
4
269 Views
Last Modified: 2012-08-14
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
0
Comment
Question by:Mr_Shaw
  • 2
  • 2
4 Comments
 
LVL 16

Expert Comment

by:santoshmotwani
ID: 34979151
0
 

Author Comment

by:Mr_Shaw
ID: 34979201
Why is this not in the constraints folder?
0
 
LVL 16

Accepted Solution

by:
santoshmotwani earned 500 total points
ID: 34979275
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
 

Author Closing Comment

by:Mr_Shaw
ID: 34979342
thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Help - 12 42
search for a string in all tables 4 15
SQL Transaction logs 8 11
How toselect unique values 3 10
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now