Help with querry add silks to 1 player

05/16/2017 03:41 EQuiNoXsro#1
How totle say i need querry add silks just to 1 player i need update the silks not set the ampunt of silks . Like if player have 123 silks when use querry add 150 silk should be 273 silks .
05/16/2017 04:55 Muhab*#2
Actually that query requires a very very basic knowledge about SQL!

Quote:
Code:
UPDATE table_1 SET column_1+= @silks WHERE column_2 = @jid
IF @@ROWCOUNT=0
	INSERT INTO table_1 VALUES(JID, @silks, 0, 0)
I don't really remember table & column names correctly and lazy to check them so just modify them..
05/16/2017 13:27 EQuiNoXsro#3
And where put silks and where put char name ?
05/16/2017 17:59 Snow*#4
[Only registered and activated users can see links. Click Here To Register...]
Quote:
Originally Posted by Pr0x! View Post
Code:
USE SRO_VT_SHARD-- Use SHARD database
DECLARE @CharName16 varchar(64)
DECLARE @UserID INT
DECLARE @silk int
SET @silk = '9999' --Silk Here
SET @CharName16 = 'Zed*' --CharName here
SET @UserID = (select UserJID from _User where CharID = (SELECT CharID FROM _Char where CharName16 = @CharName16))
UPDATE SRO_VT_ACCOUNT.dbo.SK_Silk set silk_own = silk_own + @silk where JID = @UserID