同步表中数据的问题。。。
两个表A,B
A中有数据列名为id(自增减的)a,b,c
B中有数据列名为id(自增减的)a,x,y
怎样实现A表中的数据在增加的时候,B表中的a同时自动增加呢?
[解决办法]
create trigger ins on a
for insert
as
insert into b (a,x,y) select a,b,c from inserted
go
发布时间: 2012-04-23 13:17:38 作者: rapoo
同步表中数据的问题。。。
两个表A,B
A中有数据列名为id(自增减的)a,b,c
B中有数据列名为id(自增减的)a,x,y
怎样实现A表中的数据在增加的时候,B表中的a同时自动增加呢?
[解决办法]
create trigger ins on a
for insert
as
insert into b (a,x,y) select a,b,c from inserted
go