(Solved) : Far Create Trigger Tgrexcessinventory Productionproductinventory Update Exists Select True Q44021622 . . .
I have this so far:
CREATE TRIGGER tgrExcessInventory
on Production.ProductInventory
FOR UPDATE
AS
IF EXISTS
(SELECT ‘True’
FROM Inserted i
JOIN Deleted d
ON i.productID = d.ProductID
AND i.locationID = d.LocationID
WHERE (d.quantity + i.quantity) >= 800 OR
i.quantity >=800
)
BEGIN
RAISERROR(‘Cannot increase stock where units would be over 800units’,16,1)
ROLLBACK TRAN
END
1.) I just need help with modifying this trigger to execute itscheck code only if the Quantity column is updated.
***If additional information is needed, let me know exactly whatso I can edit the question.
Thank you.
Expert Answer
Answer to I have this so far: CREATE TRIGGER tgrExcessInventory on Production.ProductInventory FOR UPDATE AS IF EXISTS (SELECT ‘Tr…
OR