Aan de slagGa gratis aan de slag

Preventing changes to Products

The Fresh Fruit Delivery company doesn't want regular users to be able to change product information or the actual stock.

Deze oefening maakt deel uit van de cursus

Building and Optimizing Triggers in SQL Server

Cursus bekijken

Oefeninstructies

  • Create a new trigger, PreventProductChanges, that prevents any updates to the Products table.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

-- Prevent any product changes
CREATE TRIGGER ___
ON ___
___ ___ UPDATE
AS
	RAISERROR ('Updates of products are not permitted. Contact the database administrator if a change is needed.', 16, 1);
Code bewerken en uitvoeren