Morning all Brother
can any one help me for edit query to work to search buy itemcode and and add maxcount items
can any one help me for edit query to work to search buy itemcode and and add maxcount items
Code:
USE SRO_VT_ACCOUNT
DECLARE @Serial bigint
declare @CID int
declare @AID int
declare @ItemCode varchar(50)
declare @loc varchar(50)
set @loc = 'inventory'
---------------------------------------------------
SET @Serial = YOUR_SERIAL_HERE
---------------------------------------------------
SET @CID = (select CharID from SRO_VT_SHARD.dbo._Inventory where ItemID = (select ID64 from SRO_VT_SHARD.dbo._Items where Serial64 like @Serial))
if @CID is null
begin
SET @AID = (select UserJID from SRO_VT_SHARD.dbo._Chest where ItemID = (select ID64 from SRO_VT_SHARD.dbo._Items where Serial64 like @Serial))
SET @loc = 'chest'
end
else if @AID is null
begin
SET @AID = (select UserJID from SRO_VT_SHARD.dbo._User where CharID = (select OwnerCharID from SRO_VT_SHARD.dbo._CharCOS where ID = (select COSID from SRO_VT_SHARD.dbo._InvCOS where ItemID = (select ID64 from SRO_VT_SHARD.dbo._Items where Serial64 like @Serial))))
SET @loc = 'pet'
end
else
begin
SET @AID = (select UserJID from SRO_VT_SHARD.dbo._User where CharID = @CID)
end
SET @ItemCode = (select CodeName128 from SRO_VT_SHARD.dbo._RefObjCommon where ID = (select RefItemID from SRO_VT_SHARD.dbo._Items where Serial64 like @Serial))
SELECT top 1 tbuser.StrUserID as AccID, chart.CharName16 as CharName, @Serial as Serial, @ItemCode as ItemCode, @loc as Location
FROM TB_User as tbuser
JOIN SRO_VT_SHARD.dbo._AccountJID as accjid on tbuser.JID = accjid.JID
JOIN SRO_VT_SHARD.dbo._User as usert on accjid.JID = usert.UserJID
JOIN SRO_VT_SHARD.dbo._Char as chart on usert.CharID = chart.CharID
WHERE usert.UserJID = @AID