Recommended Servers - Topics UP



Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: Como Agregar Usuario Vip en los files Emu s6 Epi 3  (Visto 942 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline jesusGgRc Posteado: March 13, 2017, 12:43:02 AM | Modificado: March 13, 2017, 01:17:52 AM by jesusGgRc

Como Agregar Usuario Vip en los files Emu s6 Epi 3!!!!


Offline Overkomp #1 Posteado: March 13, 2017, 12:54:55 AM | Modificado: March 13, 2017, 01:17:24 AM by overkomp

Query:

UPDATE MEMB_INFO SET AccountLevel = 1, AccountExpireDate = GETDATE() + 30 WHERE memb___id = 'LOGIN'

explicación:

Donde dice : AccountLevel = aca va el nivel del vip ( 1,2 o 3) 
                     el numero 30 son los dias de vip
                     y donde dice LOGIN  va el id del usuario que quieren hace vip.

Procedimiento para que el VIP expire Automaticamente:

Citar
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
 
ALTER Procedure [dbo].[WZ_GetAccountLevel]
@Account varchar(10)
AS
BEGIN
 
SET NOCOUNT ON
SET XACT_ABORT ON
 
DECLARE @CurrentAccountLevel int
DECLARE @CurrentAccountExpireDate smalldatetime
 
SELECT @CurrentAccountLevel=AccountLevel,@CurrentAccountExpireDate=AccountExpireDate FROM MEMB_INFO WHERE memb___id=@Account
 
IF(@CurrentAccountLevel <> 0 AND getdate() > @CurrentAccountExpireDate)
BEGIN
    SET @CurrentAccountLevel = 0
 
    UPDATE MEMB_INFO SET AccountLevel=@CurrentAccountLevel,AccountExpireDate=@CurrentAccountExpireDate WHERE memb___id=@Account
END
 
SELECT @CurrentAccountLevel As AccountLevel,@CurrentAccountExpireDate As AccountExpireDate
 
SET NOCOUNT OFF
SET XACT_ABORT OFF
 
END
GO
 
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO

Gracias:


Offline Overkomp #2 Posteado: March 13, 2017, 01:15:35 AM | Modificado: March 13, 2017, 01:18:52 AM by overkomp

Tienes que colocarlo como procedimiento en  el sqlserver.
 seguro que la próxima pregunta es como se pone un procedimiento, jajaajaja


Offline jesusGgRc #3 Posteado: March 13, 2017, 01:17:21 AM

jajajaja listo broo gracias... tema solucionado xD


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Recommended Servers - Topics Bottom



 

Related Topics

  Subject / Started by Replies Last post
3 Replies
1322 Views
Last post August 27, 2017, 05:41:01 PM
by Natzugen
3 Replies
773 Views
Last post September 01, 2017, 01:32:44 AM
by DeilanSasame
2 Replies
526 Views
Last post July 30, 2018, 09:40:59 AM
by Deidad
8 Replies
1783 Views
Last post September 29, 2018, 02:39:00 PM
by Anemone
1 Replies
361 Views
Last post January 28, 2019, 06:01:10 PM
by JYachelini