ADD_PREM_USER Database Procedure

Knight Online private server tutorials/guides, new releases, and discussion
Post Reply
User avatar
DeadPoetic
Posts: 57
Joined: Fri Aug 17, 2018 3:45 am

Sat Aug 18, 2018 10:47 pm

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
Image
Post Reply