Tuesday, September 9, 2014

Maintenance: How to change SQL Server Agent Log location.


1) Open SQL Server SSMS and execute following script,

USE MASTER
GO
EXEC msdb..sp_get_sqlagent_properties
GO


Output:
Here you will get the current SQL Server agent log location as in below screenshot,


2) Now execute following script by updating the value to new location.

 
USE MASTER
GO
EXEC msdb.dbo.sp_set_sqlagent_properties @errorlog_file=N'D:\MSSQL10.MSSQLSERVER\MSSQL\Log\SQLAGENT.OUT'
GO


3) Now, you have to restart the SQL Server agent service in order to update the log location.


No comments:

Post a Comment