标题:[求助]帮看看这个语句怎么改
只看楼主
kaihua
Rank: 1
等 级:新手上路
帖 子:78
专家分:0
注 册:2004-11-26
结帖率:66.67%
 问题点数:0 回复次数:2 
[求助]帮看看这个语句怎么改

CREATE PROCEDURE RMS_INCREASEBONUSQUESTCOUNT
@GameID varchar(14)
AS

set nocount on

declare @IncreaseBonusError int, @InsertLogError int, @STotalBonus int
set @IncreaseBonusError = 1
set @InsertLogError = 1
set @STotalBonus = 0

begin transaction

update tblGameID1 set SBonus = SBonus + 1, STotalBonus = STotalBonus + 1 where GameID = @GameID
set @IncreaseBonusError = @@ERROR

select @STotalBonus = STotalBonus from tblGameID1 where GameID = @GameID

insert tblBonus2Log1 (GameID, STotalBonus, Kind) values (@GameID, @STotalBonus, 1)
set @InsertLogError = @@ERROR

if @IncreaseBonusError = 0 AND @InsertLogError = 0
begin
commit transaction
end
else
begin
rollback transaction
end
GO

能不能 帮 把以上 SBonus = SBonus + 1, STotalBonus = STotalBonus + 1
设置成 当 STOTALBONUS < 100 SBonus <100 的时候
才可以 SBonus = SBonus + 1, STotalBonus = STotalBonus + 1

搜索更多相关主题的帖子: 语句 
2005-12-14 22:16
卜酷塔
Rank: 7Rank: 7Rank: 7
来 自:魅力青岛
等 级:禁止访问
威 望:39
帖 子:2569
专家分:0
注 册:2004-6-12
得分:0 

update tblGameID1 set SBonus = SBonus + 1, STotalBonus = STotalBonus + 1
where (GameID = @GameID )and ( STOTALBONUS < 100)and(SBonus <100)

desgin by 卜酷塔

[此贴子已经被作者于2005-12-15 11:26:12编辑过]


觉得为时已晚的时候,恰恰是最早的时候。

2005-12-15 11:25
kaihua
Rank: 1
等 级:新手上路
帖 子:78
专家分:0
注 册:2004-11-26
得分:0 
太谢谢了
真是好斑竹 :)
2005-12-15 19:21



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-38209-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.347561 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved