Quote:
Originally Posted by SlayeR
3. Submitting a petition does not take away from your '4' petitions daily.
|
this will do the trick
Code:
/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
CREATE TABLE dbo.UserPetitions
(
account_id int NULL,
amount int NULL
) ON [PRIMARY]
GO
COMMIT
insert into UserPetitions values(0,20061008);
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[up_Server_GetCurrentQuota]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
-- =============================================
-- Author: <Sauron>
-- Create date: <10.8.2006>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[up_Server_GetCurrentQuota]
-- Add the parameters for the stored procedure here
@accountuid int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
declare @today int;
set @today = (select (year(getdate()) * 100 + dbo.FormatNumber(month(getdate())))*100+dbo.FormatNumber(day(getdate())));
if(SELECT amount FROM UserPetitions WHERE account_id=0) <> @today
begin
DELETE FROM UserPetitions WHERE account_id <> 0;
UPDATE UserPetitions SET amount = @today WHERE account_id = 0;
SELECT 0 as amount;
end;
else
SELECT isnull( sum(amount) , 0) as amount FROM UserPetitions WHERE account_id = @accountuid;
END
'
END
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[up_Server_UpdateQuota]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
-- =============================================
-- Author: <Sauron>
-- Create date: <10.8.2006>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[up_Server_UpdateQuota]
-- Add the parameters for the stored procedure here
@accountuid int,
@amount int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
declare @today int;
set @today = (select (year(getdate()) * 100 + dbo.FormatNumber(month(getdate())))*100+dbo.FormatNumber(day(getdate())));
if(SELECT amount FROM UserPetitions WHERE account_id=0) <> @today
begin
DELETE FROM UserPetitions WHERE account_id <> 0;
UPDATE UserPetitions SET amount = @today WHERE account_id = 0;
end;
else
begin
if exists(select * from UserPetitions where account_id = @accountuid)
UPDATE UserPetitions SET amount = amount + @amount WHERE account_id = @accountuid;
else
INSERT INTO UserPetitions values(@accountuid,1);
end;
END
'
END
Quote:
Originally Posted by SlayeR
4. There are always 11-12 petitions open.
|
i saw the same problem on retail C5 server
any idea about evaluate? i saw it enable just ones and dunno why -_-