PRIMARY KEY CONSTRAINT

Primary Keys Must

  • not nullable
  • clustered, sorts
  • one per table
  • surrogate keys  column may be added if there is not a primary key in a table.
  • natural Key: risks of primary key changing.
  • EACH CONSTRAINT NAME MUST BE UNIEQULY NAMED AS WELL

 

Alter table to make a column a Primary Key

ALTER TABLE TABLE_NAME

ADD CONSTRAINT {OPTIONAL CONSTRAINT ID} PRIMARY KEY (COLUMN_NAME)

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top