felipecoder
23/07/2017, 04:10 PM
Vi uma galera com dificuldade pra fazer umas query que eu também estava procurando e nosso amigo louis compartilhou
E muita gente ainda ficou com duvidas então decidi postar as que adaptei
Premiar BloodCastle
CREATE TRIGGER [dbo].[PREMIO_BC] ON [dbo].[RankingBloodCastle]
AFTER UPDATE
AS
SET NOCOUNT ON
SET XACT_ABORT ON
[Only registered and activated users can see links]
DECLARE valor_novo int
DECLARE valor_anterior int
[Only registered and activated users can see links]
SELECT valor_anterior = Score FROM DELETED
[Only registered and activated users can see links]
IF valor_novo > 0) and valor_novo > valor_anterior)
[Only registered and activated users can see links]
SET NOCOUNT OFF
SET XACT_ABORT OFF
Premiar ChaosCastle
CREATE TRIGGER [dbo].[PREMIO_CC] ON [dbo].[RankingChaosCastle]
AFTER UPDATE
AS
SET NOCOUNT ON
SET XACT_ABORT ON
[Only registered and activated users can see links]
DECLARE valor_novo int
DECLARE valor_anterior int
[Only registered and activated users can see links]
SELECT valor_anterior = Score FROM DELETED
[Only registered and activated users can see links]
IF valor_novo > 0) and valor_novo > valor_anterior)
[Only registered and activated users can see links]
SET NOCOUNT OFF
SET XACT_ABORT OFF
Premiar DevilSquare
CREATE TRIGGER [dbo].[PREMIO_DC] ON [dbo].[RankingDevilSquare]
AFTER UPDATE
AS
SET NOCOUNT ON
SET XACT_ABORT ON
[Only registered and activated users can see links]
DECLARE valor_novo int
DECLARE valor_anterior int
[Only registered and activated users can see links]
SELECT valor_anterior = Score FROM DELETED
[Only registered and activated users can see links]
IF valor_novo > 0) and valor_novo > valor_anterior)
[Only registered and activated users can see links]
SET NOCOUNT OFF
SET XACT_ABORT OFF
Premiar IllusionTemple
CREATE TRIGGER [dbo].[PREMIO_IT] ON [dbo].[RankingIllusionTemple]
AFTER UPDATE
AS
SET NOCOUNT ON
SET XACT_ABORT ON
[Only registered and activated users can see links]
DECLARE valor_novo int
DECLARE valor_anterior int
[Only registered and activated users can see links]
SELECT valor_anterior = Score FROM DELETED
[Only registered and activated users can see links]
IF valor_novo > 0) and valor_novo > valor_anterior)
[Only registered and activated users can see links]
SET NOCOUNT OFF
SET XACT_ABORT OFF
Como alterar a premiação
[Only registered and activated users can see links]
gold é a coluna da moeda
o 20 é a quantidade de moeda que vai ser inserido
Créditos
Eu por adaptar louis por fazer
E muita gente ainda ficou com duvidas então decidi postar as que adaptei
Premiar BloodCastle
CREATE TRIGGER [dbo].[PREMIO_BC] ON [dbo].[RankingBloodCastle]
AFTER UPDATE
AS
SET NOCOUNT ON
SET XACT_ABORT ON
[Only registered and activated users can see links]
DECLARE valor_novo int
DECLARE valor_anterior int
[Only registered and activated users can see links]
SELECT valor_anterior = Score FROM DELETED
[Only registered and activated users can see links]
IF valor_novo > 0) and valor_novo > valor_anterior)
[Only registered and activated users can see links]
SET NOCOUNT OFF
SET XACT_ABORT OFF
Premiar ChaosCastle
CREATE TRIGGER [dbo].[PREMIO_CC] ON [dbo].[RankingChaosCastle]
AFTER UPDATE
AS
SET NOCOUNT ON
SET XACT_ABORT ON
[Only registered and activated users can see links]
DECLARE valor_novo int
DECLARE valor_anterior int
[Only registered and activated users can see links]
SELECT valor_anterior = Score FROM DELETED
[Only registered and activated users can see links]
IF valor_novo > 0) and valor_novo > valor_anterior)
[Only registered and activated users can see links]
SET NOCOUNT OFF
SET XACT_ABORT OFF
Premiar DevilSquare
CREATE TRIGGER [dbo].[PREMIO_DC] ON [dbo].[RankingDevilSquare]
AFTER UPDATE
AS
SET NOCOUNT ON
SET XACT_ABORT ON
[Only registered and activated users can see links]
DECLARE valor_novo int
DECLARE valor_anterior int
[Only registered and activated users can see links]
SELECT valor_anterior = Score FROM DELETED
[Only registered and activated users can see links]
IF valor_novo > 0) and valor_novo > valor_anterior)
[Only registered and activated users can see links]
SET NOCOUNT OFF
SET XACT_ABORT OFF
Premiar IllusionTemple
CREATE TRIGGER [dbo].[PREMIO_IT] ON [dbo].[RankingIllusionTemple]
AFTER UPDATE
AS
SET NOCOUNT ON
SET XACT_ABORT ON
[Only registered and activated users can see links]
DECLARE valor_novo int
DECLARE valor_anterior int
[Only registered and activated users can see links]
SELECT valor_anterior = Score FROM DELETED
[Only registered and activated users can see links]
IF valor_novo > 0) and valor_novo > valor_anterior)
[Only registered and activated users can see links]
SET NOCOUNT OFF
SET XACT_ABORT OFF
Como alterar a premiação
[Only registered and activated users can see links]
gold é a coluna da moeda
o 20 é a quantidade de moeda que vai ser inserido
Créditos
Eu por adaptar louis por fazer