Your query looks just like mine but using a while loop instead of a single operation. Why would you do that.
Without DDL and sample data, I can't be sure why are you using those triggers. I can only be sure about one thing, you don't need 2 as they can be part of the same trigger.