Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenSQLServerInstanceRegKey:GetRegKeyAccessMask failed (reason: 2)

Tags:

sql-server

Using SQL server 2012 I got the following error from my Windows Server 2012 R2

OpenSQLServerInstanceRegKey:GetRegKeyAccessMask failed (reason: 2).

like image 874
Jonathan Sameniego Avatar asked Sep 18 '14 15:09

Jonathan Sameniego


2 Answers

I found my answer - SQLServer Express edition does not support SQL Server Agent.

like image 103
user3790568 Avatar answered Sep 21 '22 02:09

user3790568


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...

like image 30
SimonB Avatar answered Sep 20 '22 02:09

SimonB