difference Primary Key and a clustered index

  • Hi,

    just what is the difference between a PK and a clustered index?

    They are the same thing right?

    Or is a PK an implied clustered index by virtue of being a unique constraint.

    Any simple answer welcome as I got this in an interview last week.

    I haven't seen a clear-cut layman's explaination anywhere.

    Eamon

  • The one most common difference which is coming to my mind right now is Clustered index will sort your data in table(either Ascending or Descending) But making a primary key on a table will not do so.

  • Primary Key is a constraint and a clustered index is usually the main index of a table although you are not required to create one.  So both are not required just good practice.  Your questions are answered in detail in the link below.  Hope this helps.

    http://www.sql-server-performance.com/q&a71.asp

    Kind regards,
    Gift Peddie

  • Thanks alot for this guys both make this very clear now

    Eamon

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply