当前位置: 代码迷 >> Sql Server >> !触发器跳不过去?
  详细解决方案

!触发器跳不过去?

热度:7   发布时间:2016-04-27 17:20:52.0
求助!!!触发器跳不过去???
create trigger interg_disc 
on members
for update 
as
begin
  /*declare @memberID int,@integral int
  select @memberID=memberID ,@integral=integral from members where status='true'
  if(@integral>300 and @integral<600 )
  update members set discount=0.8 where [email protected]
  else if(@integral>600)
  update members set discount=0.7 where [email protected]
  update members set status='false' where [email protected]*/
end

跳出:消息 102,级别 15,状态 1,第 1 行
' ' 附近有语法错误。

------解决方案--------------------
interg_disc后又一个全角空格
------解决方案--------------------
这样就行了.
SQL code
create trigger interg_discon membersfor updateasbegindeclare @memberID int,@integral int  select @memberID=memberID ,@integral=integral from members where status='true'  if(@integral>300 and @integral<600 )  update members set discount=0.8 where [email protected]  else if(@integral>600)  update members set discount=0.7 where [email protected]  update members set status='false' where [email protected]end
------解决方案--------------------
begin和end之间要有内容
  相关解决方案