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
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