Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

?
-- =============================================
-- Description: Returns detail data for from batch logs for reporting.
--
-- Maintenance Log:
--
-- Update By Update Date Description
-- ----------- --------- ----------------------------
-- =============================================
CREATE PROCEDURE [dbo].[uspRptDetBatchLogs]
-- Add the parameters for the stored procedure here
@minRequestDate datetime,
@maxRequestDate datetime,
@tableNames varchar(max)

AS
BEGIN
DECLARE @tmpMaxDate datetime
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

BEGIN TRY
--to make sure the full day has been returned, add a day to the maxRequestDate
IF @maxRequestDate Is Not Null
BEGIN
SET @tmpMaxDate = DATEADD(day, 1, @maxRequestDate);
END
--make sure the max date is not less than the min date
IF @tmpMaxDate <= @minRequestDate
BEGIN
SET @tmpMaxDate = DATEADD(day, 1, @minRequestDate);
END

SELECT
BatchLogID
, TableName
, BatchDate
, LoadStatus
, LoadCompleteDate
, BatchRecordCount
, BadBatch
FROM BatchLogs
WHERE (BatchDate >= @minRequestDate OR @minRequestDate IS NULL)
AND (BatchDate <= @tmpMaxDate OR @tmpMaxDate IS NULL)
AND (TableName In(SELECT [Value] FROM ufnSplit(',', @tableNames)) OR @tableNames IS NULL)
ORDER BY BatchDate DESC
;
END TRY

BEGIN CATCH
PRINT 'There was an error processing the detail batch logs report' + CHAR(13);
SELECT * FROM dbo.ufnGetErrorInfo();
EXEC uspRaiseErrorInfo;
END CATCH

--DECLARE @webMessage varchar(MAX)
--SET @webMessage= 'Date Range: ' + CONVERT(varchar(12), @minRequestDate, 120 ) + ' - ' + CONVERT(varchar(12), @maxRequestDate, 120 ) + ', ADDomains Selected: ' + @adDomains + ', Requested Pages: ' + @requestPages + ', Selected Users: ' + @userName
--EXEC uspSaveRptParameters @userId, 'uspRptWebLogDetails', @webMessage
END
GO