The sql server agent service on local computer started and stopped

Issue Unable to start SQL Server Agent. Produces the following error when trying to start it from the services control panel. "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."

Product Line

Struxureware Power Monitoring Power Monitoring Expert ION Enterprise

Environment

SQL Server 2005, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014

Cause

There was no such directory present on the machine and also the SQLAgent.out log file did not exist.

Resolution


*Warning: This article contains information about editing the registry. Improper changes to the registry can permanently damage the operating system. Always backup the registry before making any changes.* Manually try to start SQL Server Agent from a command prompt using the following command: SQLAGENT90 -C -V>C:\SQLAGENT.OUT Check the contents of the SQLAgent.out file produced by this command.  Should contain an message as per below: 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) 2014-08-24 10:10:31 - ! [241] Startup error: Unable to initialize error reporting system (reason: The system cannot find the path specified) 2014-08-24 10:10:31 - ? [098] SQLServerAgent terminated (normally) Check the value of key ErrorLogFile in the following registry key. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\SQLServerAgent Change the value in the ErrorLogFile key to reflect the correct location of the SQL log folder.

After making the change and saving, restart the SQL Server Agent from the services control panel.

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900

I'm unable to start the SQL Server agent in services. I'm getting the following error while starting.

SQL Server Agent service in local computer started and then stopped. Some services automatically stop if they have no work to do, for example, the performance logs and alert service.

If you give the SQL Agent service account Windows local administrator rights, you can bypass most security restrictions that might stop Agent from working. However, you are then running Agent with moer rights than it needs.

In SQL Server 2005, neither the Agent account or the SQL Server account need to have Windows local admin rights.

1) Look in BOL 'Setting up Windows Service Accounts' and ensure SQL and Agent have the rights specified. Also look at the rights listed in 'Enabling memory support for over 4GB physical memory' and 'Database File initialization'.

2) Ensure the service accounts have Read authority on the Windows 'Event Log' and 'Remote Procedure Call (RPC)' services. Agent will not run if it cannot determine the status of Event Log.

3) Ensure the service account used for Agent is defined as a login to SQL Server.

This should get you past most problems, and avoid the need to run the services with local admin authority.

Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

SantoshUmarani-1390 asked Jul 20, '21 | SeeyaXi-msft commented Jul 23, '21

Hi,

SQL server (SQLXPRESS2014) is getting stopped automatically. In the event viewer I am getting the following error message.

SQL Server is terminating because of fatal exception c0000005. This error may be caused by an unhandled Win32 or C++ exception, or by an access violation encountered during exception handling. Check the SQL error log for any related stack dumps or messages. This exception forces SQL Server to shutdown. To recover from this error, restart the server (unless SQLAgent is configured to auto restart).

Can you please let me know what could be the reason of this issue ?
Kindly waiting for your resposne.

Thanks,Santosh

sql-server-general

Comment

I have created one sample of node js . But when I start the application is going to connection of sql server then not give response by sql server.

When i going in service panel and start sql server agent then give blow error....

This service on local computer started and then stopped. some service stop automatically if then are not in use by other service or programs

The sql server agent service on local computer started and stopped

OR.........

When i am going in the sql server config and start of sql server agent then show error

The request failed or the service did not respond in a timely fashion. Consult the event log log or other application error for details.

The sql server agent service on local computer started and stopped

3