Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Cycle The SQL Server Error Log

From Wiki

Jump to: navigation, search

When you do a SQL Server restart SQL server closes the current error log file and cycles the error log extension numbers. Every time SQL Server is started, the current error log is renamed to errorlog.1; errorlog.1 becomes errorlog.2, errorlog.2 becomes errorlog.3

What if you don't restart the SQL Server" Your log file can become huge. What can you do? You can run the sp_cycle_errorlog stored proc

  1. exec sp_cycle_errorlog

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.

Permissions: Execute permissions for sp_cycle_errorlog are restricted to members of the sysadmin fixed server role.

Contributed by: --SQLDenis 16:07, 10 June 2008 (GMT)

Part of SQL Server Admin Hacks

399 Rating: 2.4/5 (43 votes cast)