34,590
社区成员
发帖
与我相关
我的任务
分享
create table t1(id int identity(1,1),val varchar(10))
create table t2(t1id int)
go
create trigger setsumidtot2
on t1
for insert
as
insert into t2 select id from inserted
go
insert into t1(val) values('abc')
select * from t2
/*
t1id
-----------
1
(1 行受影响)
*/
go
drop table t1,t2