Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[SQL] usp_nickname_update

Status
Not open for further replies.
Creator of Code
Joined
Mar 5, 2006
Messages
371
Reaction score
131
Here is my post from this thread. Forgot to add is as a release.

USE [Pangya_S4_TH]
GO
/****** Object: StoredProcedure [dbo].[USP_NICKNAME_UPDATE] Script Date: 02/01/2011 22:12:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[USP_NICKNAME_UPDATE]
@x int,
@y varchar(20)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @Occupied INT
EXEC @Occupied = [dbo].[USP_NICKNAME_CHECK] @y
IF @Occupied = 0 BEGIN
UPDATE Pangya_Member_Info
SET NickName = @y WHERE UID = @x
SELECT 0
END
ELSE BEGIN
SELECT 1
END
END
 
Last edited:
Newbie Spellweaver
Joined
Nov 23, 2010
Messages
18
Reaction score
0
Re: [Release] USP_NICKNAME_UPDATE

@chreadie
your SQL seems to be wrong.. my nick in game is change, but when we re-login, the nick seem's not change perfectly..

the right SQL syntax is :

Code:
USE [Pangya_S4_TH]
GO
/****** Object:  StoredProcedure [dbo].[USP_NICKNAME_UPDATE]    Script Date: 02/28/2011 02:19:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[USP_NICKNAME_UPDATE]
@x int,
@y varchar(20)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @Occupied INT
EXEC @Occupied = [dbo].[USP_NICKNAME_CHECK] @y
IF @Occupied = 0 BEGIN
UPDATE Pangya_Member_Info
SET NickName = @y WHERE [COLOR="Red"]UID = @x[/COLOR]
SELECT 0
END
ELSE BEGIN
SELECT 1
END
END

see? the userid data type is varchar, but we need UID value not the userid.

go try to change your nick-name in game and after logging out and login back, your nick-name will be changed perfectly with no error :D:

CMIIW
 
Status
Not open for further replies.
Back
Top