Tadit Dash Solution Is Good But What Happened When You Have Excessive Number Of Parents/Childs.
One Solution Is To Use While Loop With exists keyword instead of using if
like
Declare @nextParent int;
insert into tbl_level(Parentid,childid,rewardpoint,earnedmoney,noofchild) values(@parentkey,@CusId,1,convert(decimal,(@BookingAmt/10)),1)
while exists (select @nextParent=childid from tbl_level where childid=@parentkey)
begin
update tbl_level set earnedmoney= earnedmoney+@earnedmoney where parentid=(select Parentid from tbl_level where Childid=@parentkey)
end