CREATE PROCEDURE LOAD_PREMIUM_SERVICE_USER
@AccountID varchar(27),
@nRet1 smallint OUTPUT,
@nRet2 smallint OUTPUT
AS
DECLARE @nRow smallint
SET @nRow = 0
DECLARE @Type smallint
SET @Type = null
DECLARE @Days smallint
SET @Days = null
SELECT @nRow = COUNT(*) FROM PREMIUM_SERVICE WHERE strAccountID = @AccountID
IF @nRow = 0
BEGIN
SET @nRet1 = 0 --Fail (Account don´t have premium service)
SET @nRet2 = 0 --Fail (Account don´t have premium service)
RETURN
END
BEGIN TRAN
SELECT @Type = strType, @Days = nDays FROM PREMIUM_SERVICE WHERE strAccountID = @AccountID
IF @Days = 0
BEGIN
DELETE FROM PREMIUM_SERVICE WHERE strAccountID = @AccountID
SET @nRet1 = 0 --Fail (Account don't have more premium days)
SET @nRet2 = 0 --Fail (Account don't have more premium days)
RETURN
END
COMMIT TRAN
SET @nRet1 = @Type
SET @nRet2 = @Days
GO
=======================
CREATE PROCEDURE [dbo].[UPDATE_WAREHOUSE_PW]
@accountid varchar(21),
@WarehousePassword varchar(17),
@Money int,
@dwTime int,
@strItem varchar(1600),
@strSerial varchar(1600)
AS
IF DATALENGTH(@WarehousePassword) < 6 OR @WarehousePassword IS NULL
BEGIN
SET @WarehousePassword = '000000'
END
UPDATE WAREHOUSE
Set
nMoney = @Money,
dwTime = @dwTime,
WarehouseData = @strItem,
strSerial = @strSerial,
strWarehousePW=@WarehousePassword
WHERE strAccountID = @accountid
GO |