• I'd dump the cursor, put set-based code in the trigger, and call it a day.

    Or, better yet, use a proc for all updates/inserts into the table, and have the proc handle all the logic internally, and get rid of the trigger completely.

    - 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