Hello. I have the following table in SQL Server 2008
The goal is to update the Value field on a child and accumulate on the parent. For example: If in the record of id 12 I put the value 31 in the value field, its direct parent (8) should receive the value 31. If in the id record 11 I put 25, your direct parents (6,4,3,1) should get 25 more in the value field.
Is there any way to do this without using looping (and recursive CTEs)?