DELETE Trigger vs Stored Procedure to deal with eliminating rows that are dependent

DELETE Trigger vs Stored Procedure to deal with eliminating rows that are dependent

I have seen various posts on how to implement the deletion of reliant rows from other tables making use of CASCADE DELETE or other ways of creating or l king up dependencies and producing powerful SQL.

I am perhaps not crazy about the thought of using CASCADE delete if for no other explanation than the overhaead concerns simply because that the CASCADE issues therefore many DELETEs for records that have numerous dependencies that have their very own many dependencies (not to mention the fact that the outcome are hard to track rather than all that well-suited to manufacturing environments).

Therefore, having resigned myself to composing them in one single way or another, i am wondering exactly what the trade-off is always to putting all the necessary deletes into a stored procedure or even a delete trigger.

I love the DELETE trigger option, because the semantics are kept by it of deletion straight forward. That is

Will need care of the many deleting that should be cared for and no solitary designer can make the error of maybe not calling the deletion procedure

Nonetheless, I am concerned about the utilization of causes since I appear to notice a fair amount of ‘expert’ recommendations against their [frequent] use.

From my viewpoint, the actual implementation of the TRIGGER vs the stored procedure seems nearly identical. Therefore, supplied internally we follow a practice that is consistent it appears that the TRIGGER solution should work out simply fine. Read more…