Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

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

0 Miembros and 1 Guest are viewing this topic.

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

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

Offline Overkomp #1 Posteado: March 12, 2017, 11:54:55 PM | Modificado: March 13, 2017, 12: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, 12:15:35 AM | Modificado: March 13, 2017, 12: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, 12:17:21 AM

jajajaja listo broo gracias... tema solucionado xD

Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
1154 Views
Last post August 27, 2017, 04:41:01 PM
by Natzugen
3 Replies
647 Views
Last post September 01, 2017, 12:32:44 AM
by DeilanSasame
2 Replies
426 Views
Last post July 30, 2018, 08:40:59 AM
by Deidad
8 Replies
1267 Views
Last post September 29, 2018, 01:39:00 PM
by Anemone
1 Replies
275 Views
Last post January 28, 2019, 05:01:10 PM
by JYachelini