Assume:
Table A, containing "Master" records
Fields KeyField, SumAmount (being the SUM(Amount) from table B for KeyField 'K')
Table B, containing "Child" records, fields KeyField, Amount
On insert, update, delete in B I'd like to update the SumAmount in table A,
but not, of course for the entire table, just for the ones with the KeyField 'K'
I've tried calling a stored procedure from the trigger, but I have to somehow pass the Keyfield value of the inserted/updated record(s) from table B to the sp, and I have not been able to figure out how to do that.
So:
1) Can I do this with a trigger?
2) If yes, how?
TIA
Peter Pirker
Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?
(Woody Allen)