Hello , I was wondering if you have any SQL table , I can be sending cards to the players.
Hello , I was wondering if you have any SQL table , I can be sending cards to the players.
give me more details
Say I wanted to give a player with a card , but I 'm not in the game. And please send by SQL .
DECLARE @UID INT
DECLARE @carD_TYPEID INT
DECLARE @carD_QTY INT
SET @UID = 1 -- your uid
SET @carD_TYPEID = 1 -- card type number
SET @carD_QTY = 1 -- card quantity to add
IF EXISTS(SELECT 1 FROM TD_CARD_USRS WHERE UID = @UID AND CARD_TYPEID = @carD_TYPEID) BEGIN
UPDATE TD_CARD_USRS SET QTY = QTY + @carD_QTY , USE_YN = 'Y' WHERE UID = @UID
END ELSE BEGIN
INSERT INTO TD_CARD_USRS(UID,CARD_TYPEID,QTY,USE_YN) VALUES (@UID @carD_TYPEID @carD_QTY,'Y')
END
I could not use the query . More could manually , thank you!
Error: Msg 102, Level 15, State 1, Line 12
Incorrect syntax near '@carD_TYPEID'
Forums is freak its change my code try to uppercase @carD_TYPEID AND @carD_QTYCode:DECLARE @UID INT DECLARE @carD_TYPEID INT DECLARE @carD_QTY INT SET @UID = 1 -- your uid SET @carD_TYPEID = 1 -- card type number SET @carD_QTY = 1 -- card quantity to add IF EXISTS(SELECT 1 FROM TD_CARD_USRS WHERE UID = @UID AND CARD_TYPEID = #D_TYPEID) BEGIN UPDATE TD_CARD_USRS SET QTY = QTY + @carD_QTY , USE_YN = 'Y' WHERE UID = @UID END ELSE BEGIN INSERT INTO TD_CARD_USRS(UID,CARD_TYPEID,QTY,USE_YN) VALUES (@UID @carD_TYPEID, @carD_QTY,'Y') END
try this link
Last edited by top1; 10-11-15 at 08:21 AM.
Thank you so much!
It seems the problem has been solved , I will be closing the thread for now ,if the problem still persists and OP desires the thread to be opened again , please drop me a PM
Last edited by Vaulient; 15-11-15 at 06:22 PM.