Register for your free account! | Forgot your password?

You last visited: Today at 02:33

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

Advertisement



Help with SQL Stored Procedure

Discussion on Help with SQL Stored Procedure within the SRO PServer Questions & Answers forum part of the SRO Private Server category.

Reply
 
Old   #1
 
rieljames's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 177
Received Thanks: 36
Help with SQL Stored Procedure

Hi to all SQL pros out there.

I'm to create a stored procedure for tests and learning purposes only. The problem im having is if I execute [_ADD_ITEM_EXTERN], it only executes the first two instances and only gives me two items instead of 6.

My code:
PHP Code:
USE [SRO_VT_SHARDLOG]
GO
/****** Object:  StoredProcedure [dbo].[_YAWA]    Script Date: 11/10/2021 10:04:18 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
-------------------------------------------------------------------------------------------------------------------
ALTER procedure [dbo].[_ANIMAL] [MENTION=3898309]charname[/MENTION]EQ varchar(64), [MENTION=395373]Chari[/MENTION]D int, [MENTION=954425]plus[/MENTIONint

AS
DECLARE [
MENTION=748716]Degree[/MENTIONvarchar(128), [MENTION=782085]chest[/MENTIONvarchar(128), [MENTION=412764]legs[/MENTION]  varchar(128), [MENTION=324753]arms[/MENTION]  varchar(128), [MENTION=548095]coronet[/MENTION]  varchar(128), [MENTION=915752]foot[/MENTION]  varchar(128), [MENTION=4433738]Shoulder[/MENTION]  varchar(128)

SET [MENTION=748716]Degree[/MENTION] = '02'
SET [MENTION=782085]chest[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_BA_C_RARE'
SET [MENTION=412764]legs[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_LA_C_RARE'
SET [MENTION=324753]arms[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_AA_C_RARE'
SET [MENTION=548095]coronet[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_CA_C_RARE'
SET [MENTION=915752]foot[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_FA_C_RARE'
SET [MENTION=4433738]Shoulder[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_SA_C_RARE'

        
        
BEGIN EXEC SRO_VT_SHARD.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=782085]chest[/MENTION], 1, [MENTION=954425]plus[/MENTIONEND
        BEGIN EXEC SRO_VT_SHARD
.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=412764]legs[/MENTION], 1, [MENTION=954425]plus[/MENTIONEND
        BEGIN EXECUTE 
[MENTION=1593521]Results[/MENTION]RO_VT_SHARD.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=324753]arms[/MENTION], 1, [MENTION=954425]plus[/MENTIONEND
        BEGIN EXECUTE SRO_VT_SHARD
.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=548095]coronet[/MENTION], 1, [MENTION=954425]plus[/MENTIONEND
        EXECUTE SRO_VT_SHARD
.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=915752]foot[/MENTION], 1, [MENTION=954425]plus[/MENTION]
        
EXECUTE SRO_VT_SHARD.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=4433738]Shoulder[/MENTION], 1, [MENTION=954425]plus[/MENTION]
        
EXECUTE [SRO_RJ_SHA].[dbo].[_FN_ADD_INITIAL_EQUIP] [MENTION=395373]Chari[/MENTION]D5444855 
rieljames is offline  
Old 10/12/2021, 01:10   #2

 
Ryotic's Avatar
 
elite*gold: 276
Join Date: Nov 2016
Posts: 440
Received Thanks: 117
Quote:
Originally Posted by rieljames View Post
Hi to all SQL pros out there.

I'm to create a stored procedure for tests and learning purposes only. The problem im having is if I execute [_ADD_ITEM_EXTERN], it only executes the first two instances and only gives me two items instead of 6.

My code:
PHP Code:
USE [SRO_VT_SHARDLOG]
GO
/****** Object:  StoredProcedure [dbo].[_YAWA]    Script Date: 11/10/2021 10:04:18 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
-------------------------------------------------------------------------------------------------------------------
ALTER procedure [dbo].[_ANIMAL] [MENTION=3898309]charname[/MENTION]EQ varchar(64), [MENTION=395373]Chari[/MENTION]D int, [MENTION=954425]plus[/MENTIONint

AS
DECLARE [
MENTION=748716]Degree[/MENTIONvarchar(128), [MENTION=782085]chest[/MENTIONvarchar(128), [MENTION=412764]legs[/MENTION]  varchar(128), [MENTION=324753]arms[/MENTION]  varchar(128), [MENTION=548095]coronet[/MENTION]  varchar(128), [MENTION=915752]foot[/MENTION]  varchar(128), [MENTION=4433738]Shoulder[/MENTION]  varchar(128)

SET [MENTION=748716]Degree[/MENTION] = '02'
SET [MENTION=782085]chest[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_BA_C_RARE'
SET [MENTION=412764]legs[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_LA_C_RARE'
SET [MENTION=324753]arms[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_AA_C_RARE'
SET [MENTION=548095]coronet[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_CA_C_RARE'
SET [MENTION=915752]foot[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_FA_C_RARE'
SET [MENTION=4433738]Shoulder[/MENTION] = 'ITEM_CH_M_HEAVY_' + [MENTION=748716]Degree[/MENTION] + '_SA_C_RARE'

        
        
BEGIN EXEC SRO_VT_SHARD.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=782085]chest[/MENTION], 1, [MENTION=954425]plus[/MENTIONEND
        BEGIN EXEC SRO_VT_SHARD
.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=412764]legs[/MENTION], 1, [MENTION=954425]plus[/MENTIONEND
        BEGIN EXECUTE 
[MENTION=1593521]Results[/MENTION]RO_VT_SHARD.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=324753]arms[/MENTION], 1, [MENTION=954425]plus[/MENTIONEND
        BEGIN EXECUTE SRO_VT_SHARD
.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=548095]coronet[/MENTION], 1, [MENTION=954425]plus[/MENTIONEND
        EXECUTE SRO_VT_SHARD
.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=915752]foot[/MENTION], 1, [MENTION=954425]plus[/MENTION]
        
EXECUTE SRO_VT_SHARD.[dbo].[_ADD_ITEM_EXTERN] [MENTION=3898309]charname[/MENTION]EQ, [MENTION=4433738]Shoulder[/MENTION], 1, [MENTION=954425]plus[/MENTION]
        
EXECUTE [SRO_RJ_SHA].[dbo].[_FN_ADD_INITIAL_EQUIP] [MENTION=395373]Chari[/MENTION]D5444855 
Sro_RJ_SHA?
Ryotic is offline  
Old 10/12/2021, 21:21   #3
 
elite*gold: 0
Join Date: Jul 2020
Posts: 202
Received Thanks: 176
It is very hard to read your code, why don't you add a txt file?

If the first two items out of 6 are working, please copy paste the first two "exec" lines two times more and change the 4 lines you get to the other 4 items. 1 and 2 look similar and are working
3 and 4 look similar and are not working
5 and 6 look similar and are not working
OKeks is offline  
Reply


Similar Threads Similar Threads
[Buying] Need help with MySQL stored procedure
08/10/2016 - Coders Trading - 1 Replies
Hey, I´d like to add a stored procedure to my database and run it every X hours. I have no idea how to setup so Im asking here for some help and I´m willing to donate some Paypal $$. Thanks, Wakan88
[SQL] Stored Procedure for TitleUpdating Automatic
05/08/2013 - SRO PServer Guides & Releases - 11 Replies
heya guys, this was made a looooooong time ago when we wanted to make title giving automatic on devias. however, it was never used cuz of lazyness. Just found it again and thought i´d release it. This is to be executed each time a new uniquelog is added. It works like this gets the first charname that killed the MOB "Devias". If you kill devias for the first time u get the title Devias Slayer #1 for the second time Devias Slayer #2 etc.
[HELP]Res toon stored Procedure
07/23/2010 - Shaiya Private Server - 0 Replies
Hi all, hopefully someone can tell me what i am doing wrong. I am trying to use the dbo.usp_GM_Recovery_Char and it completes without errors but it doesn't res the toon. can anyone tell me how to fix this. I am tired of ressing them manually. thanks alot!!



All times are GMT +2. The time now is 02:33.


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.