I recently migrated my system databases to a new location.
I then experienced failures of my SQL Agent jobs with the following error:
2015-10-03 01:53:10 - ! [136] Job - reported: Unable to open Step output file.
I can set the location for the step output file by accessing the 'Job Step Properties - Advanced' tab, but it is blank.
Where is the default location for this?
I have found resources which specify it is The default location depends on the location of your
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log\xxxxx.txt
but this is not the case on my server. Is there an environment variable that holds the path to MSSQL\Log as I changed the directory and this would explain why the failures occurred. I would like to update the default without having to enter a static location for every job.
I initially thought this could be set by using the sp_set_sqlagent_properties store procedure like so:
USE MASTER
GO
EXEC msdb.dbo.sp_set_sqlagent_properties
@errorlog_file=N'U:\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLAGENT.OUT'
GO
But this still allows existing jobs to fail.
Is there a way to script the update of the step file location from one drive to another but using the same file paths and names?