Tuesday, August 8, 2017

SQLServerAgent could not be started (reason: Unable to connect to server '(local)'; SQLServerAgent cannot start).


If SQL Server agent not started and if you find below error in event viewer

Error Details

 Log Name             :         Application
Source                  :         SQLSERVERAGENT
Date                      :         8/8/2017 3:49:43 PM
Event ID               :         103
Task Category      :         Service Control
Level                    :         Error
Keywords             :      Classic
User                      :          N/A
Computer             :      VmSQLServer
Description           :
SQLServerAgent could not be started (reason: Unable to connect to server '(local)'; SQLServerAgent cannot start).















Solution 

Provide instance in  in "ServerHost" under

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.MSSQLSERVER\SQLServerAgent

Goto run
type regedit
expand HKEY_LOCAL_MACHINE --> SOFTWARE --> Microsoft --> Microsoft SQL Server
click on SQLServerAgent in Microsoft SQL Server
In right side pane double click on ServerHost and provide instance name under  value data