none
what really primary key does? RRS feed

  • Question

  • i want to know what pk internally do?
    Brainstorm your Brain and find solution,if no result stuck to Brainstormer.
    Sunday, October 25, 2009 11:32 AM

Answers

  • They prevent the creation of another record with the same idenitification. You can use UNIQUE as well, but you can only have one Primary Key on a table, where as you can create many UNIQUE constraints
    Abdallah, PMP, MCTS
    Sunday, October 25, 2009 11:57 AM

All replies

  • They prevent the creation of another record with the same idenitification. You can use UNIQUE as well, but you can only have one Primary Key on a table, where as you can create many UNIQUE constraints
    Abdallah, PMP, MCTS
    Sunday, October 25, 2009 11:57 AM
  • In addition to Abdshall note, a clustered unique index is created automatically on the PK column to enforce the UNIQUE KEY constraint. Clustering is optional though.


    Kalman Toth, SQL Server & BI Training, SSAS, SSIS, SSRS; http://www.SQLUSA.com
    Sunday, October 25, 2009 7:59 PM
    Moderator
  • In addition to Kalman's note, a Primary Key is the default COLUMN(s) for the FOREIGN KEY to REFERENCE.
    Monday, October 26, 2009 3:38 PM
    Moderator