[thelist] Friday Freebie (yes, its back, for now)

Scott Dexter sgd at ti3.com
Fri, 3 Dec 1999 16:39:38 -0600


<tip title="2 points on Primary Keys and Unique constraints" type="SQL
Server">

1) Enforcing Integrity
A PK on multiple columns will allow an insert based on uniqueness of the
specific combination of values (i.e. the same branchid but different
groupids)

A Unique constraint on multiple columns enforces uniqueness on all of the
values --if any one is a duplicate the command fails (i.e. you can't have
the same branchid and different groupids)

2) Set up
You can only have one PK per table

You can have multiple Unique constraints per table
</tip>

sgd
--
think safely