Using SQL server 2012 I got the following error from my Windows Server 2012 R2
OpenSQLServerInstanceRegKey:GetRegKeyAccessMask failed (reason: 2).
I found my answer - SQLServer Express edition does not support SQL Server Agent.
I encountered the same error in the Application log on my local workstation when trying to start the SQL Agent.
The SQLAGENT.OUT file didn't exist in the Log path, mentioned in an earlier answer. I wondered if the service account for the agent lacked the permissions to access this Log folder...
I tried adding the service account "NT Service..." to the list of approved users for that folder. No joy - couldn't see the account in the list of users on the workstation.
So, I changed the service account of SQL Agent to match that of the SQL Server service. Bingo! The Agent started up, and the SQLAGENT.OUT file appeared in the log folder.
Not too worried about any security implications of making the service accounts the same for both engine and agent, as it's my local dev workstation...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With