query ban account

SQL:
USE [SRO_VT_SHARD]          

GO

--------------------------------                          

DECLARE @ChrID INT;          

DECLARE @CharName VARCHAR(64);

DECLARE @AccJID INT;          

---------------------------------

SET @CharName =    'CharNameHere'---

---------------------------------

SET @ChrID=(SELECT CharID FROM _Char WHERE CharName16=@CharName)

SET @AccJID=(SELECT UserJID FROM _User WHERE CharID=@ChrID)

-----------------------------------------------------------------

USE SRO_VT_ACCOUNT

DECLARE @ID VARCHAR (64)

DECLARE @Reason VARCHAR(128)

DECLARE @Begin DATETIME

DECLARE @End DATETIME

SET @ID = (Select STRuserID FROM TB_User Where JID = @AccJID)



---------------------------------

SET @Reason    =    'Ban Reason Here'

SET @Begin    =    '2012-05-01 00:00:00.000' --    Time Begin    --

SET @End    =    '2040-01-01 00:00:00.000' --    Time End    --

---------------------------------

---------------------------



INSERT [dbo].[_Punishment]

(

[UserJID],

[Type],

[Executor],

[Shard],

[CharName],

[CharInfo],

[PosInfo] ,

[Guide],

[Description],

[RaiseTime],

[BlockStartTime],

[BlockEndTime],

[PunishTime],

[Status]

)

VALUES

(

@AccJID,

1,

1,

0,

@CharName,

1,

1,

@Reason,

@Reason,

@Begin,

@Begin,

@End,

@End,

0);

----------------------------------------------------------

DECLARE @ReasonID INT

SET @ReasonID =

(Select SerialNo FROM _Punishment Where UserJID = @AccJID)

----------------------------------------------------------

INSERT [dbo].[_BlockedUser]

(

[UserJID],

[UserID],

[Type],

[SerialNo],

[TimeBegin],

[TimeEnd])

VALUES

(

@AccJID,

@ID,

1,

@ReasonID,

@Begin,

@End);



-----------------------------------------------------------------

SELECT StrUserID FROM TB_User WHERE JID = @AccJID

-----------------------------------------------------------------
 
التعديل الأخير بواسطة المشرف:
عودة
أعلى