• 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.

[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