difference..between PK and UK

  • I was asked this question..what is the difference...in one table a column is primary key..and in another table a column is unique key and not null..i said the second option is equivalent to primary key..Am i right?

    thks

  • They both ensure that no duplicate values can be entered into a column (or set of columns), but there are differences in how they should be used.  See UNIQUE Constraints in BOL.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Designating the column as Primary Key causes it to be used as the base lookup of any indexes that are applied to the table (by default it is also clustered, if you do not specify otherwise).

  • Certain facilities (such as full text indexes) require there to be a primary key on a table.

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

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