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
/
25131
< prev
next >
Wrap
Text File
|
2010-06-15
|
2KB
|
78 lines
CREATE PROCEDURE [dbo].[ISA_spMalwareSummary]
AS
BEGIN
SET NOCOUNT ON;
IF OBJECT_ID ('tblMalwareSummary', 'u') IS NOT NULL
DROP TABLE [tblMalwareSummary]
DECLARE @FromDate datetime
SET @FromDate = (SELECT [FromDate] FROM [tblSummaryParams])
DECLARE @LogServerName nvarchar(32)
SET @LogServerName = dbo.fnGetLogsServerName();
CREATE TABLE #table1
(
[ThreatName] varchar(255),
[ThreatLevel] int,
[LogTime] datetime
)
CREATE TABLE #table2
(
[ThreatName] varchar(255),
[ThreatLevel] int,
)
CREATE TABLE #table3
(
[ThreatName] varchar(255),
Incidents bigint,
[MalwareInspectionAction] int
)
IF OBJECT_ID ('WEB_LOGS', 'view') IS NOT NULL
BEGIN
INSERT INTO #table1
SELECT
[ThreatName] AS ThreatName,
[MalwareInspectionThreatLevel] AS ThreatLevel,
MAX([logTime]) AS LogTime
FROM WEB_LOGS
WHERE
([InternalServiceInfo] & 2) = 0 AND
[ThreatName] <> '-'
GROUP BY
[ThreatName],
[MalwareInspectionThreatLevel]
INSERT INTO #table2
SELECT
[ThreatName],
(SELECT TOP(1) ThreatLevel
FROM #table1 q
WHERE q.[ThreatName] = p.[ThreatName]
ORDER BY [logTime] DESC, [ThreatLevel] DESC
)AS [ThreatLevel]
FROM #table1 p
GROUP BY [ThreatName]
INSERT INTO #table3
SELECT
[ThreatName] AS ThreatName,
COUNT(*) as Incidents,
[MalwareInspectionAction]
FROM WEB_LOGS
WHERE
([InternalServiceInfo] & 2) = 0 AND
[ThreatName] <> '-'
GROUP BY
[ThreatName],
[MalwareInspectionAction]
END
SELECT
o.[ThreatName] AS ThreatName,
r.[ThreatLevel] AS ThreatLevel,
o.[Incidents] AS [Incidents],
o.[MalwareInspectionAction] AS [MalwareInspectionAction],
@FromDate AS Date,
@LogServerName AS ServerName
INTO [tblMalwareSummary]
FROM #table3 o
INNER JOIN #table2 r
ON o.[ThreatName] = r.[ThreatName]
INSERT INTO [tblSummaryTables] ([TableName]) VALUES ('tblMalwareSummary')
END