日期:2014-05-19  浏览次数:20452 次

求一触发器!
有两表,table1   和   table2,想更新table1中的一些记录,在更新之前将原记录保存在table2中,多谢各位!

------解决方案--------------------
呵呵
这样就可以了

create table t1 ( num int)

create table t2 (num int)

insert t1 select 1
union select 2
union select 3
union select 4
union select 5
go
create trigger t on t1 for update
as
insert t2 select * from deleted
go

update t1 set num=11 where num=1

select * from t2