How do I set up an update trigger on a child table that updates the corresponding parent row in the parent table. For example, in the child table there's a column, nProducts, which is the number of products that child provides. The parent table has a column, nTotalProducts, which is the total number of products provided by its children. So if a parent named "AParent" has 3 children, each of whom have 5 products, the nTotalProducts in the AParent should = 15.<br><br>So when the nProducts changes in one of the children from 5 to 6, the trigger should fire that updates the nTotalProducts in the parent row from 15 to 16.<br><br>What I want to do is something like this:<br><br>CREATE TRIGGER x<br>ON ChildTable<br>FOR UPDATE<br>AS<br> DECLARE @nProducts INT,<br> @iParentID INT<br><br> SET @ParentID = <br> ChildTable.iForeignKeyForParentTable <br><br> SET ParentTable.nTotalProducts = <br> (SELECT SUM(nProducts) <br> FROM ChildTable<br> WHERE ChildTable.iID = <br> [The ID of the current child row])<br> FROM ParentTable<br> WHERE ParentTable.iId = @iParentID<br><br>The sole problem I'm having is getting the foreign key value from the current row that is firing the trigger. How do I reference this?<br><br>Any and all assistance with this is GREATLY appreciated. Thanks much!<br><br>Dan<br><br>