日期:2014-05-17 浏览次数:20488 次
ALTER Trigger [dbo].[UpdateCheckAddess]
On [dbo].[CheckPD]
for Update
As
if Update(ReceAddress)
begin
UPDATE CheckPD SET
ReceAddressJ=ReceAddress.ReceAddressJ,
ReceAddress1=ReceAddress.ReceAddress,
Contact=ReceAddress.Contact,
Phone1=ReceAddress.Phone1,
Phone2=ReceAddress.Phone2
FROM CheckPD,ReceAddress
WHERE CheckPD.ReceAddress=ReceAddress.ID
end
--判断ReceAddress列的值是否被前台SQL语句更新过,如果更新过就更新上面的语句,
问题:这样写触发器就把表内所有符合条件的全部更新了,会增加服务器压力,怎么写只更新前台操过的数据,而不是全部,谢谢!