set ANSI_NULLS ON
set QUOTED_IDENTIFIER ONgoALTER TRIGGER [qiandaoTrigger]
ON [dbo].[bbsQianDao] AFTER insertAS BEGIN --SET NOCOUNT ON;declare @uid int,@count int; select @uid=uid from inserted select @count=count(*) from inserted where uid=@uid and hadreward=0 if(@count=2) --没有等于等于号(即==)begin update bbsUserReward set forumGold=forumGold+2 where userId=@uid update bbsQianDao set hadreward=1 where uid=@uidendEND