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.
Author |
Topic |
ndindi22
Starting Member
14 Posts |
Posted - 2007-08-23 : 08:38:33
|
Hi guysHow do I use trigger in MS SQL, I want to update another table every time there is change in another table.e.g everytime the no_of_days table increament by 17, must add 1 to the leave_days table or is there another way I can do this without using triggerNdindi22ndindi22 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-08-23 : 08:49:04
|
quote: or is there another way I can do this without using trigger
Yes. Use stored procedure.Write a stored procedure to update the no_of_days table and in there perform the necessary logic and update the leave_days table accordingly when the criteria is met. KH[spoiler]Time is always against us[/spoiler] |
 |
|
uday.sql
Starting Member
3 Posts |
Posted - 2007-08-23 : 18:32:24
|
Write a update trigger on the parent table to handle successive update on the child table. |
 |
|
|
|
|