Create a trigger named productsupdate that checks the new


How to code stored procedures, functions, and triggers

Exercises

Create a trigger named Products_UPDATE that checks the new value for the DiscountPercent column of the Products table. This trigger should raise an appropriate error if the discount percent is greater than 100 or less than 0.

If the new discount percent is between 0 and 1, this trigger should modify the new discount percent by multiplying it by 100. That way, a discount percent of .2 becomes 20.

Test this trigger with an appropriate UPDATE statement.

Solution Preview :

Prepared by a verified Expert
Business Management: Create a trigger named productsupdate that checks the new
Reference No:- TGS02546248

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)