✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
CREATE TRIGGER Products_Delete
ON Products
FOR DELETE
AS
IF (SELECT COUNT(*) FROM [Order Details] OD
WHERE OD.ProductID = (SELECT ProductID FROM Deleted)) > 0
BEGIN
PRINT 'Violate Foreign key reference. Rollback!!!'
ROLLBACK TRAN
END
What is the effect of this trigger?