sp_cycle_errorlog (Transact-SQL)
Applies to:
SQL Server
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.
Transact-SQL syntax conventions
Syntax
sp_cycle_errorlog
Return Code Values
0 (success) or 1 (failure)
Result Sets
None
Remarks
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, and so on. sp_cycle_errorlog enables you to cycle the error log files without stopping and starting the server.
Permissions
Execute permissions for sp_cycle_errorlog are restricted to members of the sysadmin fixed server role.
Examples
The following example cycles the SQL Server error log.
EXEC sp_cycle_errorlog ;
GO
See Also
System Stored Procedures (Transact-SQL)
sp_cycle_agent_errorlog (Transact-SQL)
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho