PDA

View Full Version : |Jobs/Query| Ranking MasterReset Diário, Semanal e Mensal (MuEmu e X-Team)



felipecoder
23/07/2017, 03:47 PM
Bom baseado nas query de resets diário, mensal e semanal
do nosso amigo s00x
Eu fiz esse ranking de Master Reset

Colunas na Character

ALTER TABLE [MuOnline].[dbo].[Character] ADD [MasterResetDay] int not null default 0
ALTER TABLE [MuOnline].[dbo].[Character] ADD [MasterResetWek] int not null default 0
ALTER TABLE [MuOnline].[dbo].[Character] ADD [MasterResetMon] int not null default 0


GO


Trigger


USE [MuOnline]
GO


SET ANSI_NULLS ON
GO


SET QUOTED_IDENTIFIER ON
GO


CREATE TRIGGER [dbo].[masterresetrank]
ON [dbo].[Character]


AFTER UPDATE
AS


IF UPDATE(MasterResetCount)
BEGIN SET NOCOUNT ON;
UPDATE [Character] set [Character].MasterResetDay=MasterResetDay+1, MasterResetWek=MasterResetWek+1, MasterResetMon=MasterResetMon+1
WHERE [Character].accountid=(SELECT accountid FROM Inserted)
AND [Character].name=(SELECT name FROM Inserted)
END


Job MasterResetDay


BEGIN TRANSACTION
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]


IF (SELECT COUNT(*) FROM msdb.dbo.syscategories WHERE name = N'[uncategorized (Local)]') < 1
[Only registered and activated users can see links]


[Only registered and activated users can see links]


[Only registered and activated users can see links]
BEGIN


[Only registered and activated users can see links]
BEGIN


RAISERROR (N'Unable to import job ''MasterResetDay'' since there is already a multi-server job with this name.', 16, 1)
GOTO QuitWithRollback
END
ELSE
[Only registered and activated users can see links]
[Only registered and activated users can see links]
END


BEGIN


[Only registered and activated users can see links]
[Only registered and activated users can see links]


[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]


[Only registered and activated users can see links]


[Only registered and activated users can see links]
[Only registered and activated users can see links]


[Only registered and activated users can see links]
[Only registered and activated users can see links]


END
COMMIT TRANSACTION
GOTO EndSave
QuitWithRollback:
[Only registered and activated users can see links]
EndSave:


Job MasterResetWek


BEGIN TRANSACTION
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]


IF (SELECT COUNT(*) FROM msdb.dbo.syscategories WHERE name = N'[uncategorized (Local)]') < 1
[Only registered and activated users can see links]


[Only registered and activated users can see links]

[Only registered and activated users can see links]
BEGIN

[Only registered and activated users can see links]
BEGIN


RAISERROR (N'Unable to import job ''MasterResetWek'' since there is already a multi-server job with this name.', 16, 1)
GOTO QuitWithRollback
END
ELSE
[Only registered and activated users can see links]
[Only registered and activated users can see links]
END


BEGIN


[Only registered and activated users can see links]
[Only registered and activated users can see links]


[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]


[Only registered and activated users can see links]


[Only registered and activated users can see links]
[Only registered and activated users can see links]


[Only registered and activated users can see links]
[Only registered and activated users can see links]


END
COMMIT TRANSACTION
GOTO EndSave
QuitWithRollback:
[Only registered and activated users can see links]
EndSave:


Job MasterResetMon


BEGIN TRANSACTION
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]


IF (SELECT COUNT(*) FROM msdb.dbo.syscategories WHERE name = N'[uncategorized (Local)]') < 1
[Only registered and activated users can see links]


[Only registered and activated users can see links]

[Only registered and activated users can see links]
BEGIN


[Only registered and activated users can see links]
BEGIN


RAISERROR (N'Unable to import job ''MasterResetMon'' since there is already a multi-server job with this name.', 16, 1)
GOTO QuitWithRollback
END
ELSE
[Only registered and activated users can see links]
[Only registered and activated users can see links]
END


BEGIN


[Only registered and activated users can see links]
[Only registered and activated users can see links]


[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]


[Only registered and activated users can see links]


[Only registered and activated users can see links]
[Only registered and activated users can see links]


[Only registered and activated users can see links]
[Only registered and activated users can see links]


END
COMMIT TRANSACTION
GOTO EndSave
QuitWithRollback:
[Only registered and activated users can see links]
EndSave:


Créditos
Eu por adaptar s00x por fazer a base

Unico
24/07/2017, 03:16 AM
obrigado eu testeare

maniacoo
24/07/2017, 01:06 PM
quem aqui acredita que foi ele quem "Adptou"

tiburski
05/08/2017, 09:19 PM
Adicionei estes ranking em meu servidor/site, no entanto o ranking de master reset semanal e mensal não estão zerando automaticamente, apenas o ranking diário de mr esta zerando automaticamente no final do dia, alguém poderia me ajudar ?

felipecoder
06/08/2017, 11:56 AM
Adicionei estes ranking em meu servidor/site, no entanto o ranking de master reset semanal e mensal não estão zerando automaticamente, apenas o ranking diário de mr esta zerando automaticamente no final do dia, alguém poderia me ajudar ?
vc habilitou a job e ligou ela?

tiburski
07/08/2017, 06:03 AM
vc habilitou a job e ligou ela?

Esqueci de habilitar as jobs.

Obrigado!