不知道MySql和SqlServer语句的区别在哪.... 我把SqlServer的trigger语句丢到MySql,竟然创建不鸟.请教一下,下面这3个Trigger,该怎么改,才能在MySql中创建.create trigger trig_insert_topic
on bbsTopic
for insert
as
declare @sid int,@uid int,@tid int
select @sid = TsID,@uid = TuID,@tid = TID from bbsTopic inserted
update bbsSection set StopicCount=StopicCount+1,SallCount=SallCount+1,SlastTopic = @tid where SID = @sid
update bbsUsers set Upoint = Upoint + 10,UtotalPost = UtotalPost + 1 where UID = @uid
create trigger trig_insert_reply
on bbsReply
for insert
as
declare @tid int,@lastreply int,@uid int,@sid int
select @sid = Rsid,@tid = RtID,@lastreply = RID,@uid = RuID from inserted
update bbsTopic set TreplyCount = TreplyCount + 1,TlastReply = @lastreply
where TID = @tid
update bbsSection set SallCount = SallCount +1 where SID = @sid
update bbsUsers set Upoint = Upoint + 2,UtotalPost = UtotalPost + 1 where UID = @uid
create trigger trig_userlevel
on bbsUsers
for update
as
declare @point int,@uid int
select @uid=UID,@point=Upoint from inserted
update bbsUsers set Ulevel =
case
when @point between 0 and 10 then 1
when @point between 11 and 50 then 2
when @point between 51 and 100 then 3
when @point between 101 and 200 then 4
when @point between 201 and 500 then 5
when @point between 501 and 1000 then 6
when @point between 1001 and 2000 then 7
when @point between 2001 and 5000 then 8
when @point between 5001 and 8000 then 9
when @point between 8001 and 10000 then 10
end
where UID = @uid