Home > SQL General > Recyle Error Log

Recyle Error Log

May 23, 2011

If you not often restart your server then your SQL Server error log files get filled up and it will take more time to load on your SSMS and sometime SSMS tale long time to respond

Let see how we can recycle the Error log. SQL Server Error log will be automatically recycle when you recycle the SQL Server or the Server .however we will not be recycle or reboot the server very often.

SQL Server has DBCC Error log command to automatically Recycle the Error Log. however we cannot run this manually so, we need to create a Automatic job to Recycle the SQL Server Error Log.

To Configure the Error Log we need to Run the following command on SQL Server 2005 or Later.

xp_instance_regwriteN’HKEY_LOCAL_MACHINE’,N’Software\Microsoft\MSSQLServer\MSSQLServer’,N’NumErrorLogs’, REG_DWORD, 6

We can limit the number of error log file by specifying number from 6 – 99 so we can have maximum of 99 files.

Categories: SQL General
%d bloggers like this: