你不要管那个“(所影响的行数为 1 行)”,看数据进去没有,下面的代码测试通过,数据添加进去了
-------------------------
if object_id('table1') is not null drop table table1
go
select 1 as col1, 'a' as col2, 'a' as col3 into table1
if object_id('table2') is not null drop table table2
go
select 1 as col1, 'a' as col2 into table2
go
if object_id('test') is not null drop trigger test
go
create trigger test on table1 for insert
as
insert into table2 select col1, col2 from inserted
go
insert into table1 values(2, 'b', 'b')
go
select * from table1
/*
col1 col2 col3
2 b b
1 a a
*/
select * from table2
/*
col1 col2
2 b
1 a
*/
drop trigger test
drop table table1
drop table table2