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
287 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Viewers will learn how the fundamental information of how to create a table.
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.

776 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