We are unable to start SQL Server Agent. It was giving the following error when we were trying to start it from the services console
The SQL Server Agent (MSSQLSERVER) service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service.
When we try to change the service account for SQL Server Agent we get the below error,
The process terminated unexpectedly. [0x8007042b]
Tried to start SQL Server Agent from the command prompt using:
SQLAGENT90 -C -V>C:\SQLAGENT.OUT
Unable to rename C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLAGENT.OUT to C:\ProgramFiles\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLAGENT.1 (reason: The system cannot find the path specified)
2007-08-24 10:10:31 - !  Startup error: Unable to initialize error reporting system (reason: The system cannot find the path specified)
2007-08-24 10:10:31 - ?  SQLServerAgent terminated (normally)
Checked the value of key ErrorLogFile in the following registry hive:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\SQLServerAgent
ErrorLogFile key had the below value:
C:\ProgramFiles\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLAGENT.out
However we did not had any such directory present on the machine. Also we did not had any SQLAgent log file.
Changed the value in the ErrorLogFile key to reflect the correct location of the log folder which was on a different drive.
After making the changes we were able to start the SQL Server Agent.
Abhishek Soni Support Engineer, Microsoft SQL Server. Mukesh Nanda,
TL, Microsoft SQL Server
Support Engineer, Microsoft SQL Server.