SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Primary Key/Unique Key (or) Unique Clustered Index


Primary Key/Unique Key (or) Unique Clustered Index

Author
Message
pradyumna.bhat
pradyumna.bhat
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 7
Hello Group,

found you online.
have a question to ask you.

why a table is permitted have only one primary key or unique key
or
why only one unique cluster index is allowed on a table

if you can able to answer my query, i'll be grateful to you
you can guide me to resource where i can get answers to such Q?'s

sorry for taking undue advantage...
apologies

regards
pradyumna
SQLZ
SQLZ
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1322 Visits: 940
Hi.

A primary key uniquely identifies a row within a table and as such you are only allowed one primary key. In relational theory there can only be one key that uniquely identifies a row.

Unique constraints enforce uniqueness within a column or set of columns (if you're using multiple columns for a constraint). From a physical point of view unique constraints are the same as primary key constraints except that you can define mulitple unique constraints on a table and unique constraints allow NULL whereas primary keys don't.

You can only have one clustered index per table because a clustered index orders the data in the table based on the definition of that index. Its physically impossible to order data on anything other than one set of columns.

In terms of online resources I'd suggest you look for something on relational database design. Learning the theory behind relational databases and their design can help understand how it translates to physical models.

Hope that helps.

Karl
source control for SQL Server
Andras Belokosztolszki
Andras Belokosztolszki
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2343 Visits: 1585
A clustered index determines the order in which data is stored in the database files on disk. You cannot store the same data in the same file in two different orders. You can read more about it on http://msdn2.microsoft.com/en-us/library/ms188783.aspx

Regards,
Andras



Andras Belokosztolszki, MCPD, PhD
GoldenGate Software
IN_Sandeep
IN_Sandeep
SSChasing Mays
SSChasing Mays (641 reputation)SSChasing Mays (641 reputation)SSChasing Mays (641 reputation)SSChasing Mays (641 reputation)SSChasing Mays (641 reputation)SSChasing Mays (641 reputation)SSChasing Mays (641 reputation)SSChasing Mays (641 reputation)

Group: General Forum Members
Points: 641 Visits: 1255
Hey pradyumna,


why a table is permitted have only one primary key or unique key
or
why only one unique cluster index is allowed on a table


Answer :

1st : A Table can have more than one unique constraints .

2nd : Clustered index is maximum one per table because of clustered index orders the data in the table based on the definition of that table.

Hope you it will work for you.

Cheers!

Sandy.

--
pradyumna.bhat
pradyumna.bhat
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 7
Hello Friends,

thanks for all the explanations...
appreciating you concern and support

thanks
pradi
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search