[sMall TuT] Add account by store procedure

Results 1 to 1 of 1
  1. #1
    Account Upgraded | Title Enabled! Duong Phan is offline
    MemberRank
    Sep 2012 Join Date
    VNLocation
    203Posts

    [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:

    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
    Now you can use it to make an accont from web more easy.




Advertisement