trigger-trigger

Description: Execute a piece of SQL when inserting, modifying, and deleting

Basic knowledge, not much to say, on the code! !

grammar:

(create)

create trigger trigger name_trigger

on 表名 for insert/update/delete

as

sql statement

go

 

Little plum: how to get the piece of code just inserted

create trigger insert_trigger

on student for insert 

as

select * from inserted --Note                   : The red area is the system temporary table, which can only be queried after the trigger is executed

go

 

I forgot if the chestnuts are accurate or not. . . . . But the table can be found! ! !

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324732867&siteId=291194637
Recommended