home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
moodle.waes.ac.uk
/
moodle.waes.ac.uk.zip
/
moodle.waes.ac.uk
/
TMG
/
SP1-TMG-KB981324-AMD64-ENU.msp
/
PCW_CAB_SHFx2
/
F2143_msfpcui.dll
/
BINARY
/
25143
< prev
next >
Wrap
Text File
|
2010-06-15
|
1KB
|
41 lines
CREATE PROCEDURE [dbo].[ISA_spUrlfSummaryMonthly]
@CurrentMonthFirstDay datetime,
@CurrentMonthLastDay datetime,
@LastDailyToKeep datetime,
@LastMonthlyToKeep datetime
AS
BEGIN
SET NOCOUNT ON;
-- move dailies to monthlies
INSERT INTO dbo.tblUrlfSummary_Monthly
SELECT
[UrlCategoryId] AS [UrlCategoryId],
[CategorizationReason] AS [CategorizationReason],
[Action] AS Action,
[UrlfMatched] AS UrlfMatched,
SUM(Requests),
SUM([BytesIn]),
SUM([BytesOut]),
SUM([TotalBytes]),
@CurrentMonthFirstDay AS Date,
'-' As [ServerName]
FROM dbo.tblUrlfSummary_Daily
WHERE (Date >= @CurrentMonthFirstDay) AND
(Date <= @CurrentMonthLastDay)
GROUP BY
[UrlCategoryId],
[CategorizationReason],
[Action],
[UrlfMatched]
-- cleanup dailies
DELETE FROM [ISA_RS_Db].[dbo].[tblUrlfSummary_Daily]
WHERE (Date < @LastDailyToKeep)
-- cleanup monthlies
DELETE FROM [ISA_RS_Db].[dbo].[tblUrlfSummary_Monthly]
WHERE (Date < @LastMonthlyToKeep)
END