34,837
社区成员




create table tb(id int)
create trigger tr_name on tb
for insert
as
if(select id from inserted)=1
return
else
insert into tb select 100
insert into tb select 0
select * from tb
/*id
-----------
0
100
(2 行受影响)*/
insert into tb select 1
select * from tb
/*
id
-----------
0
100
1
(3 行受影响)*/