use test
create table t1(id int,val varchar(10))
create table t2(id int,val varchar(10),check(id>10))
go
create trigger tr_test on t1
after insert
as begin
insert into t2
select id,val from inserted
if @@error>0
rollback tran
end
go
insert into t1 values(1,'tgq')
go
select * from t1
select * from t2
drop table t1
drop table t2
------解决方案-------------------- ....
........
insert into B表
select id,val from inserted
if @@error>0
rollback tran
return
............