Recycle SQL Server Log Files

You have two ways to recycle SQL Server log files: restart SQL Server Instance or through T-SQL: sp_cycle_errorlog.

Set how many error log files you want to keep before they are got recycled: you can choose 30 from:

>>SQL Server Logs
>> right clcik on it and choose Configure
>>Check the checkbox for Limit number of error log files before they are recycled and change the Maximum number of error log files: 30
Click OK.

Create a new job to run this : sp_cycle_errorlog as T-SQL
and schedule it to run at midnight every day.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s