• You can use a unique index. The constraint will actually create a unique index. That's how it works.

    I can't tell from the original post if it's included in the sample, but one thing you can run into with a unique constraint/index is that this won't be prevented:

    Col1 Col2

    1 2

    2 1

    The only way I know of to prevent that is through code. That means either an insert proc, or a trigger, or something of that sort. Might be other methods, but that's the only one I can think of. (I've tried a few, none worked.)

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon