Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Private Server
You last visited: Today at 06:49

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[SERVICE] SQL Queries / Procedures

Discussion on [SERVICE] SQL Queries / Procedures within the SRO Private Server forum part of the Silkroad Online category.

Reply
 
Old   #1
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 762
[SERVICE] SQL Queries / Procedures

Hello Elitepvpers Community,

because many administrators are not experience enough to develop in SQL and don't wanna ask every 2nd guy to write a simple query iŽll open this thread.

In this thread a client can write some ideas with so many information's as possible and a voluntary develop the procedure / query for it then.

for sure iŽll develop also simple queries.

if u want some complex queries / procedures i can create them as well for a payment
Syloxx is offline  
Old 06/30/2014, 14:50   #2
 
elite*gold: 17
Join Date: Aug 2010
Posts: 756
Received Thanks: 601
Media. is offline  
Thanks
1 User
Old 06/30/2014, 14:53   #3
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 762
Quote:
Originally Posted by Media. View Post
i guess u don't get the function of this thread ?

a guy can post a idea and if someone wanna develop it then he do it
Syloxx is offline  
Old 06/30/2014, 14:55   #4
 
elite*gold: 17
Join Date: Aug 2010
Posts: 756
Received Thanks: 601
I guess you don't get the function of the mentioned thread I posted. In fact it's exactly the same.
Media. is offline  
Old 06/30/2014, 14:57   #5
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 762
Quote:
Originally Posted by Media. View Post
I guess you don't get the function of the mentioned thread I posted. In fact it's exactly the same.
u can request for php developer or sql developer etc but not individual queries now plz dont fill the thread already with ur spam
Syloxx is offline  
Old 06/30/2014, 15:06   #6
 
elite*gold: 17
Join Date: Aug 2010
Posts: 756
Received Thanks: 601
Oh, so you mean someone can leave a request, and another one can offer his help?
Just like ?

Looking at the other thread it actually says

Which is for ALL requests, and of course to avoid a thread you just created.
Media. is offline  
Old 06/30/2014, 15:09   #7
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 762
Quote:
Originally Posted by Media. View Post
Oh, so you mean someone can leave a request, and another one can offer his help?
Just like ?

Looking at the other thread it actually says

Which is for ALL requests, and of course to avoid a thread you just created.
Request People???
i guess u killed your self with that post
the function of this thread is simply

find a team or request ppl for the team so there is no topic like:
'HEY MENZ MEN LOOKING FOR GEMAMESTAR'

and how i said stop spam a mod will choose whether it belongs in there or not
Syloxx is offline  
Old 06/30/2014, 15:11   #8
 
elite*gold: 17
Join Date: Aug 2010
Posts: 756
Received Thanks: 601
Quote:
Originally Posted by Syloxx View Post
Request People???

i guess u killed your self with that post
Are you aware that this is just a picture of the actual thread name?
If you spam the main section then you gotta expect spam in that thread.
Media. is offline  
Old 06/30/2014, 15:29   #9
 
mane123's Avatar
 
elite*gold: 0
Join Date: Oct 2008
Posts: 753
Received Thanks: 86
Syloxx no news for your server ?!

mane123 is offline  
Old 06/30/2014, 16:04   #10
 
Ŧєคгlєรร's Avatar
 
elite*gold: 0
Join Date: Jun 2013
Posts: 153
Received Thanks: 55
Quote:
Originally Posted by Media. View Post
Are you aware that this is just a picture of the actual thread name?
If you spam the main section then you gotta expect spam in that thread.
Media... This topic is mainly for small releases aka. requests for the queries - not team member, so I don't see any issue, that this thread is useless.

Quote:
Originally Posted by mane123 View Post
Syloxx no news for your server ?!
I think, that he has problem with ordering dedicated server as I have read on last posts.

@Thread:
Okay, so here's my really old query for cleaning vSRO database (2013, lol). It might be useful, if someone want to make his life easy and use just one line to clean whole database. Not sure is it working, just found that on my old disk, ah and warning - there might be small SQL Injection...

PHP Code:
-- Query Usageexec _ClearDB DatabaseNameDatabaseType
-- Exampleexec _ClearDB SRO_VT_ACCOUNTACC
-- Available options for DatabaseTypeACC AccountSHR ShardLOG Log
-- SupportedvSRO 188 
-- AuthorFearless3 Februrary 2013.

CREATE PROCEDURE 
[dbo].[_ClearDB]
@
DBName varchar(32),
@
DBType varchar(32)
AS

IF (@
DBName != NULL or @DBType NULL)
    print 
'Wrong database name or settings!'
    
else

IF @
DBType 'ACC'
BEGIN
    
PRINT 'Detected database type: ACCOUNT'
    
EXECUTE('USE ' + @DBName)
    PRINT 
'Using' +@DBName' as destination database'

    
TRUNCATE TABLE [dbo].[__SiegeFortressStatus__]
    
TRUNCATE TABLE [dbo].[_BlockedUser]
    
TRUNCATE TABLE [dbo].[_CasGMChatLog]
    
TRUNCATE TABLE [dbo].[_Notice]
    
TRUNCATE TABLE [dbo].[_Punishment]
    
TRUNCATE TABLE [dbo].[_ServiceManagerLog]
    
TRUNCATE TABLE [dbo].[_ShardCurrentUser]
    
TRUNCATE TABLE [dbo].[_SMCLog]
    
TRUNCATE TABLE [dbo].[QuaySoEpoint]
    
TRUNCATE TABLE [dbo].[SK_CharRenameLog]
    
TRUNCATE TABLE [dbo].[SK_DownLevelLog]
    
TRUNCATE TABLE [dbo].[SK_ITEM_GuardLog]
    
TRUNCATE TABLE [dbo].[SK_ItemSaleLog]
    
TRUNCATE TABLE [dbo].[SK_PackageItemSaleLog]
    
TRUNCATE TABLE [dbo].[SK_PK_UpdateLog]
    
TRUNCATE TABLE [dbo].[SK_ResetSkillLog]
    
TRUNCATE TABLE [dbo].[SK_Silk]
    
TRUNCATE TABLE [dbo].[SK_SilkBuyList]
    
TRUNCATE TABLE [dbo].[SK_SubtractSilk_VAS]
    
TRUNCATE TABLE [dbo].[SR_ShardCharNames]
    
TRUNCATE TABLE [dbo].[TB_Net2e]
    
TRUNCATE TABLE [dbo].[TB_Net2e_Bak]
    
TRUNCATE TABLE [dbo].[tb_partnerInfo]
    
TRUNCATE TABLE [dbo].[tb_paygate_trans]
    
TRUNCATE TABLE [dbo].[TB_User]
    
TRUNCATE TABLE [dbo].[TB_User_Bak]
    
TRUNCATE TABLE [dbo].[Test_HN]
    PRINT +@
DBName'has been successfully cleaned!'
END

ELSE
    PRINT 
'Wrong database type! Please check the query.'

IF @DBType 'SHR'
BEGIN
    
PRINT 'Detected database type: SHARD'
    
EXECUTE('USE ' + @DBName)
    PRINT 
'Using' +@DBName' as destination database'

    
TRUNCATE TABLE [dbo].[_Chest]
    
TRUNCATE TABLE [dbo].[_ChestInfo]
    
TRUNCATE TABLE [dbo].[_User]
    
TRUNCATE TABLE [dbo].[_OpenMarket]
    
DELETE FROM [dbo].[_AccountJID
    
TRUNCATE TABLE [dbo].[_GuildWar]
    
TRUNCATE TABLE [dbo].[_GuildMember]
    
TRUNCATE TABLE [dbo].[_GuildChest]
    
TRUNCATE TABLE [dbo].[_SiegeFortressStruct]
    
TRUNCATE TABLE [dbo].[_SiegeFortressObject]
    
TRUNCATE TABLE [dbo].[_SiegeFortressItemForge]
    
DELETE FROM [dbo].[_SiegeFortress]
    
INSERT INTO [dbo].[_SiegeFortress](FortressIDVALUES (1)
    
INSERT INTO [dbo].[_SiegeFortress](FortressIDVALUES (3)
    
INSERT INTO [dbo].[_SiegeFortress](FortressIDVALUES (6)
    
UPDATE [dbo].[_AlliedClansSET Ally1 '0'Ally2 '0'Ally3 '0'Ally4 '0'Ally5 '0'Ally6 '0'Ally7 '0'Ally8 '0'
    
DELETE FROM [dbo].[_GuildWHERE ID 0
    DELETE FROM 
[dbo].[_AlliedClansWHERE ID 0
    TRUNCATE TABLE 
[dbo].[_InventoryForAvatar]
    
TRUNCATE TABLE [dbo].[_TrainingCampSubMentorHonorPoint]
    
TRUNCATE TABLE [dbo].[_BlockedWhisperers]
    
TRUNCATE TABLE [dbo].[_TrainingCampMember]
    
TRUNCATE TABLE [dbo].[_CharTrijobSafeTrade]
    
DELETE FROM [dbo].[_CharTrijobWHERE CharID 0
    TRUNCATE TABLE 
[dbo].[_TimedJob]
    
TRUNCATE TABLE [dbo].[_StaticAvatar]
    
TRUNCATE TABLE [dbo].[_Inventory]
    
TRUNCATE TABLE [dbo].[_Memo]
    
TRUNCATE TABLE [dbo].[_FleaMarketNetwork]
    
TRUNCATE TABLE [dbo].[_Friend]
    
TRUNCATE TABLE [dbo].[_CharSkillMastery]
    
TRUNCATE TABLE [dbo].[_CharSkill]
    
TRUNCATE TABLE [dbo].[_InvCOS]
    
DELETE FROM [dbo].[_CharCOSWHERE ID 0
    DELETE FROM 
[dbo].[_CharWHERE CharID 0
    TRUNCATE TABLE 
[dbo].[_CharCollectionBook]
    
TRUNCATE TABLE [dbo].[_CharInstanceWorldData]
    
TRUNCATE TABLE [dbo].[_CharNameList]
    
TRUNCATE TABLE [dbo].[_CharNickNameList]
    
TRUNCATE TABLE [dbo].[_CharQuest]
    
TRUNCATE TABLE [dbo].[_ClientConfig]
    
TRUNCATE TABLE [dbo].[_DeletedChar]
    
TRUNCATE TABLE [dbo].[_GPHistory]
    
TRUNCATE TABLE [dbo].[_InventoryForLinkedStorage]
    
TRUNCATE TABLE [dbo].[_ItemPool]
    
DELETE FROM [dbo].[_ItemsWHERE ID64 0
    TRUNCATE TABLE 
[dbo].[_Skill_BaoHiem_TNET]
    
TRUNCATE TABLE [dbo].[_TimedJobForPet]
    
TRUNCATE TABLE [dbo].[_TrainingCampBuffStatus]
    
TRUNCATE TABLE [dbo].[_TrainingCampHonorRank]
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (1)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (2)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (3)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (4)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (5)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (6)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (7)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (8)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (9)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (10)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (11)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (12)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (13)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (14)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (15)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (16)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (17)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (18)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (19)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (20)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (21)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (22)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (23)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (24)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (25)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (26)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (27)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (28)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (29)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (30)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (31)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (32)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (33)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (34)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (35)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (36)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (37)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (38)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (39)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (40)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (41)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (42)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (43)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (44)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (45)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (46)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (47)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (48)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (49)
    
INSERT INTO [dbo].[_TrainingCampHonorRank](RankingVALUES (50)
    
EXEC [dbo].[_TRAINING_CAMP_UPDATEHONORRANK]
    
DELETE FROM [dbo].[_TrainingCamp]
    
TRUNCATE TABLE [dbo].[Tab_RefRanking_HunterContribution]
    
TRUNCATE TABLE [dbo].[Tab_RefRanking_RobberContribution]
    
TRUNCATE TABLE [dbo].[Tab_RefRanking_TraderContribution]
END

ELSE
    PRINT 
'Wrong database type! Please check the query.'

IF @DBType 'LOG'
BEGIN
    
PRINT 'Detected database type: LOG'
    
EXECUTE('USE ' + @DBName)
    PRINT 
'Using' +@DBName' as destination database'

    
TRUNCATE TABLE [dbo].[_LogCashItem]
    
TRUNCATE TABLE [dbo].[_LogEventChar]
    
TRUNCATE TABLE [dbo].[_LogEventItem]
    
TRUNCATE TABLE [dbo].[_LogEventSiegeFortress]
    
TRUNCATE TABLE [dbo].[_LogSchedule]
    
TRUNCATE TABLE [dbo].[_LogServerEvent]
    PRINT +@
DBName'has been successfully cleaned!'
END

ELSE
    PRINT 
'Wrong database type! Please check the query.' 
P.S. The queries are from rz, I have just glued them >_>
Ŧєคгlєรร is offline  
Old 06/30/2014, 16:12   #11
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 762
here is a ban user by charname query if needen

Code:
CREATE PROCEDURE _BanUserByCharname
	@Charname varchar(16),
	@BanReason varchar(1024),
	@BanStartTime datetime,
	@BanEndTime datetime
AS

	DECLARE @JID INT,
			@StrUserID varchar(16),
			@Serial INT,
			@CharID INT
	
	SELECT @CharID = CharID FROM SRO_CH_SHARD.._Char WHERE CharName16=@Charname
	SELECT @JID = UserJID FROM SRO_CH_SHARD.._User WHERE CharID=@CharID
	SELECT @StrUserID = StrUserID FROM TB_User WHERE JID=@JID
	
	--Check is user exists
	IF (@CharID = 0 OR @CharID IS NULL)
	BEGIN
		PRINT 'Charname not exists!'
		RETURN
	END
					
	--Check if user is already blocked
	IF( EXISTS( SELECT UserJID FROM _BlockedUser WITH(NOLOCK) WHERE UserJID = @JID AND timeBegin < GETDATE()))
	BEGIN
		PRINT 'User already banned!'
		RETURN
	END
	
	INSERT INTO _Punishment VALUES (@JID , 1 , 'Database' , 64 , @Charname , @CharID , 0 , 'Database' , @BanReason , @BanStartTime , @BanStartTime , @BanEndTime , @BanEndTime , 1)

	--Generate Serial
	SET @Serial = @@IDENTITY
	IF( @@ROWCOUNT = 0 or @@ERROR <> 0 or @Serial = 0 or @Serial is null)
	BEGIN
		PRINT 'Generate Serial failed!'
		RETURN
	END
	
	INSERT INTO _BlockedUser VALUES (@JID , @StrUserID , 1 , @Serial , @BanStartTime , @BanEndTime)
Syloxx is offline  
Old 06/30/2014, 16:33   #12
 
elite*gold: 17
Join Date: Aug 2010
Posts: 756
Received Thanks: 601
Quote:
Originally Posted by Ŧєคгlєรร View Post
Media... This topic is mainly for small releases aka. requests for the queries - not team member, so I don't see any issue, that this thread is useless.
If this has the sole purpose of a query collection there's already a thread like that
Either way this belong to the release section then.
Media. is offline  
Old 06/30/2014, 16:58   #13
 
Ŧєคгlєรร's Avatar
 
elite*gold: 0
Join Date: Jun 2013
Posts: 153
Received Thanks: 55
Quote:
Originally Posted by Media. View Post
If this has the sole purpose of a query collection there's already a thread like that
Either way this belong to the release section then.
Can you see requests in khaledlollol's thread? Because me not.
Ŧєคгlєรร is offline  
Reply


Similar Threads Similar Threads
[Procedures] AddLogItem and AddLogChar
07/16/2013 - SRO Coding Corner - 3 Replies
Hi. Can someone explain me the IDs or this procedures on logs db? I mean, on AddLogChar procedure there is "@EventID" which stands for the different events.. I only know that ID "9" is when you teleport.. Do you know any other IDs? And for AddLogItem there is @Operation, which stands for the different type events with the item.. And I figured out that @Operation "90" is when plusing your item.. Is there an ID that explain the all the IDs or maybe most of them?
[Wanted]Stored procedures
03/27/2012 - Shaiya Private Server - 5 Replies
Im in need of 3 stored procedures which iv got but theyve been messed about with so much that they are causing increasingly annoying problems usp_Try_GameLogin_Taiwan usp_Insert_Action_Log_E and usp_Try_GameLogout_R before anyone says use search i have tried multiple times to correct these and always same result works for a little while and then causes the Ps_game.exe to crash so would like a 2nd copy of them so i can compare and find what is causing this to happen
Procedures For Selling Accs
08/08/2009 - Silkroad Online - 29 Replies
Hi, If I Have An Acc To Sell, How Would I Sell For Cash? I Need Information Step By Step, Thanks.
Hotswap procedures pano???
08/23/2008 - RF Online - 2 Replies
Hotswap procedures panu ba un gawin?!... with connection d2 RSK/ASK to accesories., pls share panu e hotswap. tagalogin nyo ha. para madali ko maintindihan.ty



All times are GMT +2. The time now is 06:49.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.