• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[SOLVED]sp_EndGuBattle

Newbie Spellweaver
Joined
Apr 19, 2018
Messages
60
Reaction score
15
sp_EndGuBattle

who has this sript on database, pls share, thank you
USE [RanGame1]
GO
/****** Object: StoredProcedure [dbo].[sp_EndGuBattle] Script Date: 5/20/2022 8:34:21 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE Procedure [dbo].[sp_EndGuBattle]
@GuSNum int,
@GuPNum int,
@GuFlag int,
@GuKillNum int,
@GuDeathNum int,
@nReturn int OUTPUT
AS
DECLARE @error_var int,
@rowcount_var int

SET NOCOUNT ON

SET @nReturn = 0
SET @error_var = 0
SET @rowcount_var = 0

BEGIN

IF @GuFlag = 6 --Win
begin

UPDATE GuildInfo
SET GuBattleWin = GuBattleWin + 1
WHERE GuNum=@GuSNum
End
else IF @GuFlag = 5 --Lose
Begin

UPDATE GuildInfo
SET GuBattleLose = GuBattleLose + 1
WHERE GuNum=@GuSNum
End
else IF @GuFlag = 1 --Draw
Begin

UPDATE GuildInfo
SET GuBattleDraw = GuBattleDraw + 1
WHERE GuNum=@GuPNum
End


--INSERT INTO GuildBattle (GuSNum, GuPNum, GuFlag, GuKillNum,GuDeathNum)
--VALUES (@GuSNum, @GuPNum, @GuFlag, @GuKillNum,@GuDeathNum)

SELECT @error_var = @@ERROR, @rowcount_var = @@ROWCOUNT
IF @error_var <> 0 OR @rowcount_var = 0
BEGIN
SET @nReturn = 0
SET NOCOUNT OFF
RETURN @nReturn
END
END
SET @nReturn = 1
SET NOCOUNT OFF
RETURN @nReturn




set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
 
Upvote 0
Junior Spellweaver
Joined
Feb 28, 2014
Messages
117
Reaction score
11
USE [RanGame1]
GO
/****** Object: StoredProcedure [dbo].[sp_EndGuBattle] Script Date: 5/20/2022 8:34:21 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE Procedure [dbo].[sp_EndGuBattle]
@GuSNum int,
@GuPNum int,
@GuFlag int,
@GuKillNum int,
@GuDeathNum int,
@nReturn int OUTPUT
AS
DECLARE @error_var int,
@rowcount_var int

SET NOCOUNT ON

SET @nReturn = 0
SET @error_var = 0
SET @rowcount_var = 0

BEGIN

IF @GuFlag = 6 --Win
begin

UPDATE GuildInfo
SET GuBattleWin = GuBattleWin + 1
WHERE GuNum=@GuSNum
End
else IF @GuFlag = 5 --Lose
Begin

UPDATE GuildInfo
SET GuBattleLose = GuBattleLose + 1
WHERE GuNum=@GuSNum
End
else IF @GuFlag = 1 --Draw
Begin

UPDATE GuildInfo
SET GuBattleDraw = GuBattleDraw + 1
WHERE GuNum=@GuPNum
End


--INSERT INTO GuildBattle (GuSNum, GuPNum, GuFlag, GuKillNum,GuDeathNum)
--VALUES (@GuSNum, @GuPNum, @GuFlag, @GuKillNum,@GuDeathNum)

SELECT @error_var = @@ERROR, @rowcount_var = @@ROWCOUNT
IF @error_var <> 0 OR @rowcount_var = 0
BEGIN
SET @nReturn = 0
SET NOCOUNT OFF
RETURN @nReturn
END
END
SET @nReturn = 1
SET NOCOUNT OFF
RETURN @nReturn




set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
Thank You Very Much sir for your kindness, šŸ„°šŸ„°šŸ„°
 
Upvote 0
Back
Top