Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Stored Procedure & Trigger

Author  Topic 

Al_423
Starting Member

3 Posts

Posted - 2006-05-11 : 23:15:41
I am a beginner and need help with SP and Trigger. Here is the scenario:
EMP(Eno,sal,Dno);
DEPT(Dno,Mgr,Tot_Sal_Emp);
Dno in EMP is foreign key. Tot_Sal_Emp is sum of all salary of employees from a given department. How do I write SP and trigger so that when new employees are ADDED, DELETED, OR their salaries are updated, the Tot_Sal_Emp in DEPT table reflects the change.

Thanks,
Al

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-05-11 : 23:21:14
Dup of http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=65964


KH

Go to Top of Page
   

- Advertisement -