LLI Wiki — My Digital Knowledge Base

SQL Server: cycle the error log and the Agent error log

Close the current error log and start a new one with sp_cycle_errorlog and sp_cycle_agent_errorlog.

The SQL Server error log and the SQL Server Agent error log can grow very large and become hard to read. Two stored procedures "cycle" them: the current log is closed and a new one is started, without restarting the service.

SQL Server error log

EXEC sp_cycle_errorlog ;
GO

SQL Server Agent error log

USE msdb ;
GO

EXEC dbo.sp_cycle_agent_errorlog ;
GO

Notes

Mastodon LLIMastodon SocialFosstodon