Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Primary Key/Unique Key (or) Unique Clustered Index Expand / Collapse
Author
Message
Posted Wednesday, March 19, 2008 1:57 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, March 26, 2008 9:20 AM
Points: 2, 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
Post #471413
Posted Wednesday, March 19, 2008 2:49 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, November 24, 2014 6:23 AM
Points: 870, Visits: 912
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
Post #471419
Posted Wednesday, March 19, 2008 2:50 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 26, 2012 5:26 AM
Points: 1,367, Visits: 1,585
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
Post #471420
Posted Wednesday, March 19, 2008 3:17 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, March 7, 2011 3:15 AM
Points: 375, Visits: 1,255
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.





--
Post #471434
Posted Wednesday, March 19, 2008 4:05 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, March 26, 2008 9:20 AM
Points: 2, Visits: 7
Hello Friends,

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

thanks
pradi
Post #471466
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse