Pages

Add Account ACE Online

[sMall TuT] Add account by store procedure
Because i love this game since it was release first time, i quit it long time ago but now i'm going to play it again, so i'll make this game alive by first small tut.

in atum2_db_account create a new store procedure named [atum_Add_Account] , and then replace it with this code:
USE [atum2_db_account]
GO
/****** Object:  StoredProcedure [dbo].[atum_Add_Account]    Script Date: 7/22/2013 7:58:17 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


--------------------------------------------------------------------------------
-- Name: dbo.atum_Add_Account
-- Desc: -- // 2013-07-22 by Duong Phan,  atum2_db_account.dbo.atum_Add_Account()
--------------------------------------------------------------------------------
ALTER PROCEDURE [dbo].[atum_Add_Account]
 @i_AccountName VARCHAR(35),        -- AccountName
 @i_Password VARCHAR(35)        -- Password
AS
  if exists (SELECT AccountName FROM dbo.td_account WHERE AccountName = @i_AccountName) begin
   select 2 as ResultCode, 'Account already in use' as ResultMsg;
   return;
  end
  ELSE
  BEGIN
   INSERT INTO dbo.td_account (AccountName, Password)
    VALUES (@i_AccountName, @i_Password)
  END
Duong Phan
Ragezone