5 个解决方案
#1
CREATE TRIGGER 名1 ON 一个表
FOR INSERT
AS
update 另外一个表 set 某个字段=某个字段+1
go
FOR INSERT
AS
update 另外一个表 set 某个字段=某个字段+1
go
#2
creat t_trigger T_Add on table1 for insert
as
insert into table2 select count(*) as idd from table1
go
as
insert into table2 select count(*) as idd from table1
go
#3
CREATE TRIGGER 名1 ON 一个表
FOR INSERT
AS
declare @a int
select @a = count(*) from inserted
update 另外一个表 set 某个字段=某个字段+@a
go
FOR INSERT
AS
declare @a int
select @a = count(*) from inserted
update 另外一个表 set 某个字段=某个字段+@a
go
#4
用触发器.
#5
trigger
#1
CREATE TRIGGER 名1 ON 一个表
FOR INSERT
AS
update 另外一个表 set 某个字段=某个字段+1
go
FOR INSERT
AS
update 另外一个表 set 某个字段=某个字段+1
go
#2
creat t_trigger T_Add on table1 for insert
as
insert into table2 select count(*) as idd from table1
go
as
insert into table2 select count(*) as idd from table1
go
#3
CREATE TRIGGER 名1 ON 一个表
FOR INSERT
AS
declare @a int
select @a = count(*) from inserted
update 另外一个表 set 某个字段=某个字段+@a
go
FOR INSERT
AS
declare @a int
select @a = count(*) from inserted
update 另外一个表 set 某个字段=某个字段+@a
go
#4
用触发器.
#5
trigger