日期:2014-05-18  浏览次数:20399 次

求触发器
现有表a   ,a表里a1,a2,a3,a4     ,默认a1,a2已经有值,现在需要在update字段a3的时侯,通过触发器把a3字段的值也放到字段a4里面   。   谢谢有志之士

------解决方案--------------------
Create Trigger Aname
On a --在Student表中创建触发器
for Update --为什么事件触发
As --事件触发后所要做的事情
if Update(a3)
begin

Update a
Set a4=i.a3
From a , Deleted d ,Inserted i --Deleted和Inserted临时表


end