We have a situation that in a trigger we are calling one procedure to update/insert values in another table. Now, the new requirement asked that we have to cascade update foreign key on that table (SITE column). That cascade update triggers calls to that procedure in a loop, but we don't need it that way. Still, we need to check if SITE column was changed with a normal/single update. That said we could check if only one record exists in inserted table then we can exec the proc otherwise not.

Given all of the above, my question is as follows: Can we determine (in a trigger) if an update to a column value was initiated from a CASCADE update from a foreign key?

Thanks, Dejan

  • how about adding metadata column to the updated table and log that column with process name when it's updated? if its trigger you can have a value! otherwise it's from cascade update – Biju jose Jun 12 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.