if you are using SP to perform insert, update, delete into EMP table, you don't have to use trigger at all. You can handle it in your SP.-- Insert SPinsert into EMP(Eno, sal, Dno)select @eno, @sal, @dnoupdate DEPT set Tot_Sal_Emp = Tot_Sal_Emp + @sal where Dno = @dno-- Update SP-- subtract from old dept then add to new deptupdate d set Tot_Sal_Emp = Tot_Sal_Emp - e.sal from DEPT d inner join EMP e on d.Dno = e.Dno where e.Eno = @enoupdate EMP set sal = @sal, Dno = @dno where Eno = @enoupdate d set Tot_Sal_Emp = Tot_Sal_Emp + @sal where Dno = @dno
KH