Page 1 of 1

ADD_PREM_USER Database Procedure

Posted: Sat Aug 18, 2018 10:47 pm
by DeadPoetic
CREATE PROCEDURE [dbo].[ADD_PREM_USER]
@AccountID varchar(27),
@nType smallint,
@nDays smallint
AS
declare @ID varchar(27)
SELECT @ID = count(strAccountID) FROM PREMIUM_SERVICE where strAccountID = @AccountID
IF @ID = 0
BEGIN
print @AccountID +' kullanýcýsýnýn aktif bir premium uyeligi yok'
print @AccountID +' kullanýcýsýna premium ekleniyor'
INSERT INTO PREMIUM_SERVICE VALUES (@AccountID,@nType,@nDays,GETDATE())
print @AccountID +' kullanýcýsýna '+ convert(varchar,@nType) +' olarak' + convert(varchar,@nDays) + 'gün eklendi'
RETURN
END
BEGIN
print @AccountID +' kullanýcýsýnýn aktif bir premium uyeligi var'
print @AccountID +' kullanýcýsýnýn premium üyeliði deðiþiyor'
update PREMIUM_SERVICE set ndays = ndays + @ndays,[email protected] where strAccountID = @AccountID
print @AccountID +' kullanýcýsýna '+ convert(varchar,@nType) +' olarak' + convert(varchar,@nDays) + 'gün olarak deðiþti'
RETURN
END