Updating clause used in instead of trigger
For an example of If a predefined or user-defined error condition or exception occurs during the execution of a trigger body, then all effects of the trigger body, as well as the triggering statement, are rolled back unless the error is trapped by an exception handler.Therefore, a trigger body can prevent the execution of the triggering statement by raising an exception.Unlike other types of triggers, Oracle Database XE fires the trigger instead of executing the triggering SQL DML statement.
The trigger can be called before the event, to prevent erroneous operations or fix new data so that it conforms to business rules.
In the example shown here it simply counts the number of rows in the deleted table to see how many had a priority of high.
CREATE TRIGGER tr_Orders_DELETE ON Orders AFTER DELETE AS --Determine if Order with a Priority of High was deleted IF EXISTS (SELECT * FROM deleted WHERE Ord_Priority = 'High') BEGIN DECLARE @Count tinyint SET @Count = (SELECT * FROM deleted WHERE Ord_Priority = 'High') PRINT CAST(@Count as varchar(3)) ' row(s) where deleted whose priority was High' END go INSTEAD OF triggers are new to SQL Server 2000.
Oracle Database XE automatically executes a trigger when a specified event takes place, which usually is a DML statement being issued against the table.
The types of triggers are: Trigger names must be unique with respect to other triggers in the same schema.
The executable part of a trigger can contain procedural statements and SQL data manipulation statements.