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

  1. CREATE PROCEDURE [dbo].[ISA_spUrlfStatisticsRDL]
  2.     @FromDate datetime,
  3.     @ToDate datetime,
  4.     @ReportType varchar(10)
  5. AS
  6. BEGIN
  7.     -- SET NOCOUNT ON added to prevent extra result sets from
  8.     -- interfering with SELECT statements.
  9.     SET NOCOUNT ON;
  10.     DECLARE @Counters TABLE
  11.     (
  12.         CounterName nvarchar(2000),
  13.         CounterValue bigint
  14.     )
  15.     DECLARE @TotalBlockedRequests bigint
  16.     DECLARE @TotalAllowedRequests bigint
  17.     DECLARE @AvgBlockedRequestsPerDay bigint
  18.     EXEC dbo.ISA_spGetCounter N'tblUrlfSummary', N'Requests', "([Action] = 1) AND ([UrlfMatched] = 1)", @FromDate, @ToDate, @ReportType,
  19.         @TotalBlockedRequests OUTPUT
  20.     EXEC dbo.ISA_spGetCounter N'tblUrlfSummary', N'Requests', "([Action] = 0) AND ([UrlfMatched] = 1)", @FromDate, @ToDate, @ReportType,
  21.         @TotalAllowedRequests OUTPUT
  22.     DECLARE @daydiff bigint
  23.     SET @daydiff = DATEDIFF(day, @FromDate, @ToDate) + 1
  24.     IF (@daydiff = 0)
  25.         SET @AvgBlockedRequestsPerDay = -1
  26.     ELSE
  27.         SET @AvgBlockedRequestsPerDay = @TotalBlockedRequests / @daydiff
  28.     INSERT INTO @Counters
  29.     VALUES(N'{[25185]}', @TotalBlockedRequests)
  30.     INSERT INTO @Counters
  31.     VALUES(N'{[25186]}', @TotalAllowedRequests)
  32.     INSERT INTO @Counters
  33.     VALUES(N'{[25187]}', @AvgBlockedRequestsPerDay)
  34.     -- return the counters table
  35.     SELECT * FROM @Counters
  36. END
  37.