RE: Unique constraint
Posted in 1999
From: William Raper <WilliamR@catmktg.com> > >There is a very distinct advantage: REFERENTIAL INTEGRITY. > >If you have a UNIQUE INDEX on a column or group of columns, you CANNOT have >a foreign key constraint from another table referencing those columns. > >If you use a UNIQUE CONSTRAINT, a unique index is created, and you CAN have >a foreign key constraint from another table referencing those columns. This isn't the same bloke who took me to task for making a silly mistake quite recently, is it?? Last time I looked in the manual (1994 :) REFERENTIAL INTEGRITY was enforced by PRIMARY KEY and REFERENCES with NO MENTION MADE of UNIQUE CONSTRAINTs... :-) My take on UNIQUE CONSTRAINTS vs UNIQUE INDEXes is that the constraint is just more consistent with the other declarative integrity, and there's no other real benefit or difference. The UNIQUE CONSTRAINT just gets applied by a UNIQUE INDEX, anyway. ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com