Re: SQL BEFORE puzzle
Date: Tue, 5 Aug 2008 06:35:26 -0700 (PDT)
> I would expect both the BEFORE and AFTER triggers to have a view of both
> the before and after images of the data. I don't really see the need for
> before and after triggers. Perhaps I am just missing it.
I think it's largely for practical reasons.
An AFTER trigger operates on a row that has already been
physically placed somewhere in the table/index. If the trigger
wants to alter a key value, the row probably has to move,
and you end up with physical storage issues. BEFORE
triggers avoid this, so they are preferred if part of the
action is to calculate or update primary or secondary
Of course this is all implementation dependent, but
I suspect most implementations would work that way.
Of course this is all implementation dependent, but I suspect most implementations would work that way.Received on Tue Aug 05 2008 - 15:35:26 CEST