Cevap: Knight Online create_new_char tablosunu serverime nasıl eklerim ?
USE [Kn_Online]
GO
/****** Object: StoredProcedure [dbo].[CREATE_NEW_CHAR] Script Date: 10.02.2016 22:08:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[CREATE_NEW_CHAR]
@strAccountID varchar(21),
@index tinyint,
@strCharID varchar(21),
@bRace tinyint,
@sClass smallint,
@nHair int,
@bFace tinyint,
@bStr tinyint,
@bSta tinyint,
@bDex tinyint,
@bIntel tinyint,
@bCha tinyint
AS
DECLARE @bNation tinyint
DECLARE @bCharCount tinyint
DECLARE @bCount tinyint
SELECT @bNation = bNation, @bCharCount = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @strAccountID
IF (@bNation = 1 AND @bRace > 10)
RETURN 2
ELSE IF (@bNation = 2 AND @bRace < 10)
RETURN 2
ELSE IF (@bNation <> 1 AND @bNation <> 2)
RETURN 2
SELECT @bCount = COUNT(strUserID) FROM USERDATA WHERE strUserID = @strCharID
IF (@bCount > 0)
RETURN 3
BEGIN TRAN
IF (@index = 0)
UPDATE ACCOUNT_CHAR SET strCharID1 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID
ELSE IF (@index = 1)
UPDATE ACCOUNT_CHAR SET strCharID2 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID
ELSE IF (@index = 2)
UPDATE ACCOUNT_CHAR SET strCharID3 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID
IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
BEGIN
ROLLBACK TRAN
RETURN 4
END
INSERT INTO USERDATA (strUserID, Nation, Race, Class, HairRGB, Face, Strong, Sta, Dex, Intel, Cha)
VALUES (@strCharID, @bNation, @bRace, @sClass, @nHair, @bFace, @bStr, @bSta, @bDex, @bIntel, @bCha)
EXEC MASTER_AC @StrCharID
--EXEC GIVE_BEGINNER_ITEM @StrCharID
IF (@@ERROR <> 0)
BEGIN
ROLLBACK TRAN
RETURN 4
END
COMMIT TRAN
RETURN 0
Al kardeşim Query ' e yapıştır F5 yap yeter.