I’ve encountered this annoying error which causes the SQL Agent Service to immediately stop after it is started.
SQL Agent was displaying ‘Agent XPs disabled‘:
Like Microsoft tells you, run this query to enable the ‘Agent XPs’-option in SQL Server:
sp_configure 'show advanced options', 1;
sp_configure 'Agent XPs', 1;
sp_configure 'show advanced options', 0;
…SQL Agent Service still refused to start….so back to Google!
After some Googling, I’ve found this golden tip:
This error can be due to an invalid ErrorLogFile path. Check the ErrorLogFile value under the instance registry key. The default instance key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER\SQLServerAgent
It appeared that because I installed another instance earlier and uninstalled that one, somehow the SQLAGENT.OUT-file was locked. I manually deleted the file in the logging directory:
C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\SQLAGENT.OUT
After the deletion, I simply started the SQL Agent Service and it ran fine again!
Google also says:
This issue has been identified as a bug
It will be fixed with their next (service pack) update.