web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

SQL server 2008 R2-Error log File-Limit the size

(0) ShareShare
ReportReport
Posted on by 515

Hi

 How do I limit the size of Error log for SQL Server 2008 R2

C:\Program Files\Common Files\MIcrosoft Shared\Web server\Extensions\14\Data\MSSQL 10.sharepoint\mssql\log(error ;log)

I researched and found some command like "sp_errorlog"(but it will do some recycle of error log not sure what that means).

I went to SQL server Mgt studio --Configure.There u can give the number for error log but dont know how to limit the size of the error log

Can someone please help.

I have the same question (0)
  • NDingankar22 Profile Picture
    515 on at

    Restarting the SQLserver will create a new Error log. But the old one is in GB and eating space. Can someone tell me how can i limit the size of error log. The error log of Gb was unable to open at my end

  • Suggested answer
    Andre Ghazaleh Profile Picture
    870 on at

    Hi NDingankar22,


    For pre SQL server 2012 you can't set max log file size, but you can reinitialize error logs with sp_cycle_errorlog stored procedure, set an sql agent job to execute this stored procedure, and set it to run in the frequency you want, so this applies to your case (SQL 2008 R2)

    sp_cycle_errorlog Closes the current error log file and cycles the error log extension numbers just like a server restart. The new error log contains version and copyright information and a line indicating that the new log has been created.

    For SQL server 2012 and later, you can set the max log file size:

    USE [master]; 
    GO 
    EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', 
    N'Software\Microsoft\MSSQLServer\MSSQLServer', 
    N'ErrorLogSizeInKb', REG_DWORD, 5120; 
    GOCode

    In both cases increasing the number of logs you keep will help you limit the error log size.

    Source : support.microsoft.com/.../how-to-manage-the-sql-server-error-log

    Best regards

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 689

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 455 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 308 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans