tags:

views:

65

answers:

2

How do you cycle (close the existing and start a new) errorlog on SQL Server?

A: 

There is a system stored procedure, sp_cycle_errorlog, that will do this.

philcruz
+1  A: 

You can use [sp_Cycle_ErrorLog][1] for the SQL Server error log. This will stop the current one, and start a new one.

For SQL Agent Error Logs, you can use [sp_Cycle_Agent_ErrorLog][2].

You can schedule this to run as required in your environment, just note that there is a limit to how many files and how many days of history that will be retained.

Raj More