• arr.nagaraj (4/1/2009)


    CREATE TABLE [dbo].[t3] (

    [n1] [int] not null,

    [n2] [int] not null,

    [n3] as n1 + n2 ,

    [n4] as n1 * n2

    CONSTRAINT [t3_unique_key] unique (n3,n4)

    )

    Create 2 computed columns n3,n4 as shown below. declare unique key constraint on it.

    That shd detect the following scenario.

    Clever. I thought of each of those separately, but not combined. Should work.

    - 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