Skip to content
Home » Increasing the number of SQL Server Error Logs

Increasing the number of SQL Server Error Logs

  • by
SQL Server 2000 logo

Via Tim Radney, here’s a quick and easy way to increase the number of error logs from the default of six.

The blog post also has a walkthrough in SQL Server Management Studio if you prefer using the GUI.

Using TSQL you can execute the following statement to increase to 99 files, simply change 99 to how ever many files you would like to retain.

USE [master];
GO

EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'NumErrorLogs', REG_DWORD, 99;
GO

Photo by Brandi Redd on Unsplash.