日期:2014-05-18 浏览次数:20407 次
select @userinfo_integral=userinfo_integral from user_userinfo where userinfo_id=deleted.userinfo_id if(@userinfo_integral <=0) update user_userinfo set userinfo_balance=userinfo_balance-1 , userinfo_integral=userinfo_integral+10 where userinfo_id=inserted.userinfo_id ; go
------解决方案--------------------
update user_userinfo set userinfo_balance=userinfo_balance-1 , userinfo_integral=userinfo_integral+10 where userinfo_id=(select userinfo_id from inserted) ;
------解决方案--------------------
原来是掉了from "table_name"
------解决方案--------------------
lter TRIGGER updateBtoA ON [dbo].[user_userinfo]
FOR UPDATE
AS
declare @userinfo_integral int ;
select @userinfo_integral=userinfo_integral from user_userinfo
where userinfo_id=(select userinfo_id from inserted) ;
if(@userinfo_integral <=0)
update user_userinfo set userinfo_balance=userinfo_balance-1 ,
userinfo_integral=userinfo_integral+10
where userinfo_id=(select userinfo_id from inserted)
------解决方案--------------------
update user_userinfo set userinfo_balance=userinfo_balance-1 ,
userinfo_integral=userinfo_integral+10
where userinfo_id=(select userinfo_id from inserted) ;