✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
CREATE TRIGGER Products_Update
ON Products
FOR UPDATE
AS
INSERT INTO PriceTracking(ProductID, Time, OldPrice, NewPrice)
SELECT I.ProductID, GETDATE(), D.UnitPrice, I.UnitPrice
FROM Inserted I
INNER JOIN Deleted D
ON I.ProductID = D.ProductID
AND I.UnitPrice <> D.UnitPrice;
What is the purpose of this trigger?