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 / 25121 < prev    next >
Text File  |  2010-06-15  |  1KB  |  39 lines

  1. CREATE PROCEDURE [ISA_spApplicationSummary]
  2. AS
  3. BEGIN
  4.     SET NOCOUNT ON;
  5.     IF OBJECT_ID ('TblApplicationSummary', 'u') IS NOT NULL
  6.         DROP TABLE [TblApplicationSummary]
  7.     DECLARE @FromDate datetime
  8.     SET @FromDate = (SELECT [FromDate] FROM [tblSummaryParams])
  9.     IF OBJECT_ID ('FWS_LOGS', 'view') IS NOT NULL
  10.     BEGIN
  11.         SELECT
  12.             CASE
  13.                 WHEN [ClientAgent] = N'-'
  14.                      THEN N'{[23132]}'
  15.                 WHEN PATINDEX('%:%',[ClientAgent]) <= 0
  16.                      THEN N'{[23049]}'
  17.                 ELSE LOWER(LEFT([ClientAgent], PATINDEX('%:%',[ClientAgent]) - 1))
  18.             END AS [ApplicationName],
  19.             COUNT(*) AS Requests,
  20.             @FromDate AS Date
  21.         INTO [TblApplicationSummary]
  22.         FROM FWS_LOGS
  23.         WHERE
  24.             ([Action] != 8) AND
  25.             ([Action] != 10) AND
  26.             ([Action] != 11) AND
  27.             ([InternalServiceInfo] & 2) = 0
  28.         GROUP BY
  29.             CASE
  30.                 WHEN [ClientAgent] = N'-'
  31.                      THEN N'{[23132]}'
  32.                 WHEN PATINDEX('%:%',[ClientAgent]) <= 0
  33.                      THEN N'{[23049]}'
  34.                 ELSE LOWER(LEFT([ClientAgent], PATINDEX('%:%',[ClientAgent]) - 1))
  35.             END
  36.     END
  37.     INSERT INTO [tblSummaryTables] ([TableName]) VALUES ('TblApplicationSummary')
  38. END
  39.