File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Created: 2019-03-05 by Max Vernon
33Modified: 2019-03-26 by Konstantin Taranov
44Original link: https://www.sqlserverscience.com/tools/error-log-analysis-script/
55Source link: https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Read_Error_Log_File.sql
6- Note: Shows the contents of the SQL Server Error Log files, up to a maximum of the most recent 6 files.
6+ Note: Shows the contents of the SQL Server Error Log files, up to a maximum of the most recent 9 files.
77Certain "noisy" log messages are filtered out via the #exclusions temp table.
88*/
99
@@ -87,7 +87,7 @@ IF @ErrorLogCount > 9 SET @ErrorLogCount = 9;
8787DECLARE @FileNum INT ;
8888SET @FileNum = 0
8989
90- WHILE @FileNum < 7 -- @ErrorLogCount
90+ WHILE @FileNum < @ErrorLogCount
9191BEGIN TRY
9292 SET @msg = ' Retreiving log ' + CONVERT (varchar (100 ), @FileNum);
9393 RAISERROR (@msg, 0 , 1 ) WITH NOWAIT ; -- send progress to the "Messages" tab
@@ -99,8 +99,6 @@ BEGIN TRY
9999 SET ErrorLogFileNum = @FileNum
100100 WHERE ErrorLogFileNum IS NULL ;
101101
102- PRINT (@FileNum);
103-
104102 SET @FileNum = @FileNum + 1 ;
105103END TRY
106104BEGIN CATCH
You can’t perform that action at this time.
0 commit comments