1. A special stored procedure that is automatically executed when a trigger inserts, updates, or deletes a table.
2. Triggers are generally used for more complex constraints on check constraints.
3. The difference between a trigger and a normal stored procedure is that the trigger is when a table is manipulated.
4.update, INSERT, delete these operations, the system will automatically call the execution of the corresponding trigger on the table.
5. A trigger (trigger) is a special stored procedure whose execution is not invoked by the program or manually, but is triggered by an event that activates it when the operation is performed on a table (Insert,delete, update). Triggers are often used to enforce data integrity constraints and business rules, etc.
--Create TRIGGER trigger Mytrigger01 on table_1for Insert--insert trigger, Update,deleteas INSERT INTO Table_3 ( Materialname,mtype) Select top 1 materialname,mtype from table_1 the ORDER by id desc print ' Insert trigger executed successfully. ' --execute INSERT trigger takes effect insert into table_1 values (' Vivopad ', 2)
SQL Trigger (Trigger)