- CREATE PROCEDURE [dbo].[CHECK_COUPON_EVENT]
- @strAccountID char(21),
- @strCouponID char(21),
- @nRet smallint OUTPUT
- AS
- DECLARE @Row tinyint
- SELECT @Row = COUNT(AccountID) FROM COUPON_EVENT WHERE CouponID = @strCouponID OR AccountID = @strAccountID
- IF @Row = 0
- BEGIN
- SET @nRet = 0
- RETURN
- END
- SET @nRet = 1
复制代码- CREATE PROCEDURE [dbo].[UPDATE_COUPON_EVENT]
- @strAccountID char(21),
- @strCharID char(21),
- @strCouponID char(20),
- @nItemID int,
- @nItemCount int
- AS
- BEGIN TRAN
- INSERT INTO COUPON_EVENT (AccountID, CharID, CouponID, ItemID, ItemCount )
- VALUES (@strAccountID, @strCharID, @strCouponID, @nItemID, @nItemCount )
- COMMIT TRAN
复制代码 |