June 26, 2002 at 8:35 am
Hi,
Is it possible to run a trigger only when a specific *column* is updated, and not whenever any column in the table is updated?
Thanks
Andy Hall.
June 26, 2002 at 9:05 am
Look at
IF UPDATE (Column)
syntax in the CREATE TRIGGER section in BOL.
Regards,
Andy Jones
.
June 26, 2002 at 11:36 am
That method works well. Only point to remember is that updated doesnt necessarily equal changed. If the user updated the col to the same value, it still fires update().
Andy
June 26, 2002 at 12:37 pm
You can also compare the inserted and deleted tables
if exists( select a.cola from inserted a inner join deleted b on a.pk=b.pk and a.cola <> b.cola)
-- run audit trigger
Steve Jones
June 27, 2002 at 2:45 am
Thanks guys
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply