日期:2014-05-18 浏览次数:20520 次
create trigger triTest on Employees for update as if update(Technical) insert Log select a.create trigger triTest on Employees for update as if update(Technical) insert Log select a.Employeeid,getdate(),a.Technical,b.Technical from deleted a,inserted b where a.Employeeid=b.Employeeid
------解决方案--------------------
create trigger triTest on Employees for update as if update(Technical) insert Log select a.Employeeid,getdate(),a.Technical,b.Technical from deleted a,inserted b where a.Employeeid=b.Employeeid
------解决方案--------------------
--当Employees表里面的Technical字段更新时,就在Log表里面的Date字段插入更改日期,OldTechnical字段插入原 --Technical,NewTechnical字段插入更新后的Technical. create trigger 触发器名 on Employees after update as begin insert into log select a.Employeeid,getdate(),b.Technical,a.Technical from inserted a left join deleted b on a.Employeeid=b.Employeeid end