Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

Set the Maximum Size of the SQL Server Error Logs

In SQL Server 2012 and later versions, you can use xp_instance_regwrite to set the maximum size of individual error logs. Please make this setting available via SMO, instead of having to use xp_instance_regwrite.

Documentation for this feature can be found here: https://support.microsoft.com/en-us/help/2199578/how-to-manage-the-sql-server-error-log

3 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Aaron Nelson shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Aaron Nelson commented  ·   ·  Flag as inappropriate

        For those who are interested, here is the code that you would currently have to run:

        USE [master];

        GO

        EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE',

        N'Software\Microsoft\MSSQLServer\MSSQLServer',

        N'ErrorLogSizeInKb', REG_DWORD, 5120;

        GO

      Feedback and Knowledge Base