IF OBJECT_ID('tempdb..#errorLog')IS NOT NULL BEGIN;
	DROP TABLE #errorLog;
END;

DECLARE @loop INT = 0;
CREATE TABLE #errorLog (
    LogDate DATETIME NOT NULL
    , src VARCHAR(20)
    , ProcessInfo VARCHAR(64)
    , [Text] VARCHAR(MAX)
);

WHILE @loop < 7 
BEGIN
    INSERT INTO [#errorLog] ([LogDate],
                             [ProcessInfo],
                             [Text])
    EXEC [sys].[sp_readerrorlog]
        @p1 = @loop -- specify the log number or use nothing for active error log
        ,@p2 = 1 --error log
    ;
    UPDATE [#errorLog] SET [src] = 'db'
    WHERE [src] IS NULL;

    INSERT INTO [#errorLog] ([LogDate],
                             [ProcessInfo],
                             [Text])
    EXEC [sys].[sp_readerrorlog]
        @p1 = @loop -- specify the log number or use nothing for active error log
        ,@p2 = 2 --agent log
    ;
    UPDATE [#errorLog] SET [src] = 'agent'
    WHERE [src] IS NULL;

    SET @loop = @loop + 1;
END

SELECT * 
FROM #errorLog a
WHERE a.[LogDate] > '20230213 20:00:00'
--AND EXISTS (SELECT * 
--              FROM #errorLog b
--              WHERE [Text] like 'Error:%'
--                AND a.LogDate = b.LogDate
--                AND a.ProcessInfo = b.ProcessInfo)
--AND a.[LogDate] > '20230213 20:00:00'   --report that the ssl / tls was deactivated
--AND (a.[Text] like '%Error:%' OR [a].[Text] LIKE '%warning%')
ORDER BY [a].[LogDate], [a].[src] ASC 
;
