0

On "SQL Server 2019" on Windows 2019:

  1. I have opened Microsoft SQL Server Management Studio.
  2. I logged into database server.
  3. I clicked on "SQL Server Agent" and clicked on "Error logs" and double click on "Current".
  4. Log File Viewer program is displayed. On right site I see plenty of errors, but that are old errors not important anymore. How to clear/delete those errors to remove clutter?

1 Answer 1

1

You can't delete individual entries, but you can tell SQL to start a fresh log.

To start a fresh log for the SQL Server Agent Error Log:

  • exec msdb.dbo.sp_cycle_agent_errorlog; or
  • restart the SQL Server Agent service; or
  • right-click at the "Error Logs" level in Object Explorer and choose Recycle

To start a fresh log for the SQL Server Error Log:

2
  • 1
    Executing exec sp_cycle_agent_errorlog; and I have got error: Msg 2812, Level 16, State 62, Line 1 Could not find stored procedure 'sp_cycle_agent_errorlog'. Now I see I can right click on "Error Logs" folder and select "Recycle". If looking at T-SQL it is: EXEC msdb.dbo.sp_cycle_agent_errorlog
    – folow
    Commented Feb 20 at 9:02
  • 1
    I appreciate the feedback. I've updated the answer to incorporate it.
    – Doug Deden
    Commented Feb 20 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.