• Probably because, at the time the constraint is fired, the updated value hasn't been committed yet, so there's only one row with the live data, committed, and thus it doesn't violate the constraint.

    But I'm kind of guessing on that. I avoid UDFs in constraints if I can help it. I've found they create more complexity than they solve. Plus, if they have to access row data, I've seen them do all kinds of nasty things to lock escalation.

    - 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