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 12345»»»

Is a Primary Key an index? Expand / Collapse
Author
Message
Posted Tuesday, July 15, 2014 9:16 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 3:30 AM
Points: 587, Visits: 2,533
Comments posted to this topic are about the item Is a Primary Key an index?


Best wishes,

Phil Factor
Simple Talk
Post #1592889
Posted Tuesday, July 15, 2014 9:17 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:38 AM
Points: 7,700, Visits: 9,428
Irritating because over-pedantic. Good question nevertheless.

Tom
Post #1592890
Posted Tuesday, July 15, 2014 10:59 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Saturday, September 20, 2014 2:02 PM
Points: 95, Visits: 92
Question didn't really make an adequate distinction between the logical and the physical:
Does the logical definition of a Primary Key imply the presence of an index? No
In SQL Server, does the presence of a Primary Key imply some kind of index is also present? Yes
Post #1592900
Posted Tuesday, July 15, 2014 11:11 PM
SSC Eights!

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

Group: General Forum Members
Last Login: Yesterday @ 11:50 PM
Points: 805, Visits: 1,403
This is my understanding. primary key is a constraint not an index, but it creates an index automatically by default, but primary key is called a constraint not an index though. so I got it correct (though I had to think little bit)

Good question
Post #1592904
Posted Wednesday, July 16, 2014 12:23 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: Today @ 3:24 AM
Points: 962, Visits: 2,190
Thank you for the post, simply good one. (for me the question was simple enough)

ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
Post #1592918
Posted Wednesday, July 16, 2014 12:23 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: Today @ 3:24 AM
Points: 962, Visits: 2,190
pmadhavapeddi22 (7/15/2014)
This is my understanding. primary key is a constraint not an index, but it creates an index automatically by default, but primary key is called a constraint not an index though. so I got it correct (though I had to think little bit)

Good question


+1


ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
Post #1592919
Posted Wednesday, July 16, 2014 12:52 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:44 PM
Points: 12,966, Visits: 10,740
I remembered that it is sometimes called a "primary key constraint", so the question was easy enough.
Still I expect some flaming in this topic




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1592927
Posted Wednesday, July 16, 2014 12:54 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 8:48 AM
Points: 1,014, Visits: 3,288
I got it wrong because I misinterpreted this line:

When you specify a PRIMARY KEY constraint for a table, the Database Engine enforces data uniqueness by creating a unique index for the primary key columns.


It creates an index but doesn't use the PRIMARY KEY as that index. Annoying, but my fault.



On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
—Charles Babbage, Passages from the Life of a Philosopher
Post #1592928
Posted Wednesday, July 16, 2014 1:42 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Today @ 7:38 AM
Points: 749, Visits: 1,318
Koen Verbeeck (7/16/2014)
I remembered that it is sometimes called a "primary key constraint", so the question was easy enough.
Still I expect some flaming in this topic


+1, Nice question
Post #1592936
Posted Wednesday, July 16, 2014 2:04 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 8:45 AM
Points: 3,969, Visits: 5,212
TomThomson (7/15/2014)
Irritating because over-pedantic. Good question nevertheless.

+1


____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1592939
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse