logo

Crowdly

Browser

Add to Chrome

CREATE TRIGGER Products_Delete ON Products FOR DELETE AS IF (SELECT COUNT(*) FR...

✅ 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?

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.usth.edu.vn?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome