13613226668 发表于 2024-8-1 00:29:24

毒药的存储过程

毒药过程

CREATE PROCEDURE RMS_INITBONUS2
@GameID varchar(14)
AS

set nocount on

begin transaction

declare @BonusLevel int
declare @Bonus int

select @BonusLevel = Lvl from tblGameID1 where GameID = @GameID
IF@BonusLevel>1000
select @BonusLevel=1000
SET @Bonus = @BonusLevel * 2 + @BonusLevel / 100

update tblGameID1 set Strength = 10, Spirit = 10, Dexterity = 10, Power = 10, Bonus = @Bonus where GameID = @GameID
update tblGameID1 set Bonus2 = 0 where GameID = @GameID AND SBonus > STotalBonus
update tblGameID1 set Bonus2 = STotalBonus - SBonus where GameID = @GameID AND STotalBonus >= SBonus

commit transaction
GO


Chinese.Doll 发表于 2024-8-3 09:28:23

!上向天天,习学好好
页: [1]
查看完整版本: 毒药的存储过程