Sqlserve errorlog files Sometimes encounter large files, may be executed by command xp_readerrorlog or Sp_readerrorlog, you can add search text or start and end time
--Log View--exec xp_readerrorlog @FileNum, @Type, @SearchText1, @SearchText2, @StartTime, @EndTime, @order--@FileNum: Log number--@Type: Query type (1:sql Server log; 2: Agent error log)--@SearchText1: Search for text--@SearchText2: Search text (with @SearchText1 for "and" relationships)--@StartTime: Log query start time--@StartTime: Log query end time--@order: Time sort (ASC or DESC)EXECXp_readerrorlog0,1N'cannot open'N'dbname','2017-11-20','2017-11-30','DESC'execSp_readerrorlog0,1,'cannot open','dbname'
Sp_readerrorlog altogether four parameters (i.e. the first four parameters of Xp_readerrorlog)
The use of sp_helptext can be seen, Sp_readerrorlog is actually called Xp_readerrorlog
Querying SQL Agent Current log information
Exec 0,2
Another: The stored procedure sp_cycle_errorlog can generate new log files and loop the error log extension number as if the service were restarted.
EXEC Sp_cycle_errorlog GO
SQL Server Log View