复制代码 代码如下:
create table sql_test
(
id int,
name varchar(16)
)
create table sql_tem
(
id int,
name varchar(16)
)
复制代码 代码如下:
/*SQL的触发器写法*/
create trigger insert_sql_test on sql_test
for insert
as
insert into sql_tem
select * from inserted
go
/*SQL的触发器写法*/
复制代码 代码如下:
/*MySQL的触发器写法*/
delimiter//
create trigger insert_mysql_test before insert on test
for each row
begin
insert into tem set id = new id , name = new name;
/*new后面的id,name是test表的字段名*/
end
//
/*MySQL的触发器写法*/
新闻热点
疑难解答