SELECT SUBSTRING([FilePath], PATINDEX('%\[eni]%.log', [FilePath]) + 1, DATALENGTH([FilePath]) - PATINDEX('%\[eni]%.log', [FilePath]) - 1) AS [LogFile], CONVERT(char(20), Status) As [Status], CONVERT(char(15), Parser) AS [Parser], (SELECT COUNT(*) FROM HIVEMINDW3SVC1 WHERE Source = [LogSource].[ID]) AS [EntryLines], CONVERT(char(10), LineNumber) AS [SourceLines], CONVERT(char(20), Length) AS [Length], ReProc, Comment FROM LogSource WHERE Status = N'PENDING' OR Status = N'PROCESSING' OR Status = N'ERROR' ORDER BY Status DESC, LogFile ASC
SELECT SUM(LineNumber) TotalLines, (SELECT COUNT(*) FROM HIVEMINDW3SVC1) AS EntryLines FROM LogSource
