标签:style color ar for sp c on r ad
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER TRIGGER [qiandaoTrigger]
ON [dbo].[bbsQianDao]
AFTER insert
AS
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=@uid
end
END
sql server 2005中没有等于等于,高手自行跳过。。
标签:style color ar for sp c on r ad
原文地址:http://www.cnblogs.com/QMM2008/p/4009284.html