July 2, 2009 at 8:36 am
Hi,
create trigger dbo.trgMyTable_OnInsertUpdate on MyTable
FOR UPDATE,INSERT AS
--========Perform something========
BEGIN
--code
END
IF not UPDATE(someColumn)
RETURN
--=========SQL statements continues=======
BEGIN
--code
END
suppose "someColumn" is not updated
in this case, will the SQL statements after IF condtion executes or not?
Thanks,
KB
Thanks,
Santhosh
July 2, 2009 at 12:26 pm
Why don't you state that:
IF UPDATE(someColumn)
BEGIN
--code
END
This will only process if your desired column gets updated.
Eli
July 2, 2009 at 2:51 pm
Regardless of how you code it, I think you will find that the Return keyword should exit a Trigger / Procedure unconditionally.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply