Skip to content

Latest commit

 

History

History
71 lines (54 loc) · 2.63 KB

File metadata and controls

71 lines (54 loc) · 2.63 KB
title sp_cycle_agent_errorlog (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql-non-specified
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
sp_cycle_agent_errorlog
sp_cycle_agent_errorlog_TSQL
dev_langs
TSQL
helpviewer_keywords
sp_cycle_agent_errorlog
ms.assetid 8aa96182-60b7-4d7b-b2a7-ccce70378c6e
caps.latest.revision 16
author JennieHubbard
ms.author jhubbard
manager jhubbard

sp_cycle_agent_errorlog (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx_md]

Closes the current [!INCLUDEssNoVersion] Agent error log file and cycles the [!INCLUDEssNoVersion] Agent error log extension numbers just like a server restart. The new [!INCLUDEssNoVersion] Agent error log contains a line indicating that the new log has been created.

Applies to: [!INCLUDEssNoVersion] ([!INCLUDEssKatmai] through current version).

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sp_cycle_agent_errorlog  

Return Code Values

0 (success) or 1 (failure)

Result Sets

None

Remarks

Every time [!INCLUDEssNoVersion] Agent is started, the current [!INCLUDEssNoVersion] Agent error log is renamed to SQLAgent.1; SQLAgent.1 becomes SQLAgent.2, SQLAgent.2 becomes SQLAgent.3, and so on. sp_cycle_agent_errorlog enables you to cycle the error log files without stopping and starting the server.

This stored procedure must be run from the msdb database.

Permissions

Execute permissions for sp_cycle_agent_errorlog are restricted to members of the sysadmin fixed server role.

Examples

The following example cycles the [!INCLUDEssNoVersion] Agent error log.

USE msdb ;  
GO  
  
EXEC dbo.sp_cycle_agent_errorlog ;  
GO  

See Also

sp_cycle_errorlog (Transact-SQL)