1

I'm running SQL Server 2008 R2. I have to switch the local SQL Express instance to authenticate using both SQL Server and Windows. However I get this error message:

xp_regread() returned error 5, 'Access is denied.' xp_regread() returned error 5, 'Access is denied.' xp_regread() returned error 5, 'Access is denied.' (Microsoft SQL Server, Error: 22001)

I am not a sysadmin on the instance and need to recover sysadmin access so that I can change this setting.

Aaron Bertrand
  • 272,866
  • 37
  • 466
  • 490
geoff swartz
  • 5,437
  • 11
  • 51
  • 75
  • No, this has nothing to do with Parallels. Other than what's reported in `@@VERSION` SQL Server doesn't know or care that it's in a virtual machine on a Mac. Are you logged in as an administrator on the Windows machine? Is your Windows account an administrator in the SQL Server instance? What version/edition of Windows are you running? Do you have UAC enabled? – Aaron Bertrand May 22 '13 at 16:07
  • Yes, I'm logged in as an administrator. I'm not sure how to tell if my account is an administrator in the sql server instance. This is on windows 7. UAC is disabled. – geoff swartz May 22 '13 at 16:57
  • In Management Studio expand security > logins, right-click the login that is listed at the top next to the server name, and hit Properties. On the Server Roles tab take a look at what options are checked. – Aaron Bertrand May 22 '13 at 17:04
  • (Oh and if you can't access that screen that's probably a good sign you're not an admin.) – Aaron Bertrand May 22 '13 at 17:07
  • Under logins, the first one is BUILTIN\Users but the server name isn't listed. The only server role checked is public. Do I have to uninstall and reinstall sql to get this set up correctly? – geoff swartz May 22 '13 at 17:38
  • What do you mean the server name isn't listed? In Object Explorer, the very top node is your server name, right? What user is listed next to that? Now find that user in the Logins list. I don't know why you're focusing on the *first* login in that list, who isn't you. – Aaron Bertrand May 22 '13 at 17:40
  • Oh yes, it's at the very top. Sorry, I misunderstood what you were saying. No, my name is not in the list of Logins. If I right click the very top where it lists the server name followed by my username and go to permissions it shows me as part of the BUILTIN\users group. – geoff swartz May 22 '13 at 17:53
  • 3
    Seems like you are a peon on your own instance. Try this out (there are also two other articles linked to in my comment from today): http://www.mssqltips.com/sqlservertip/2682/recover-access-to-a-sql-server-instance/ Once you are connected to the instance as NT AUTHORITY\SYSTEM, you should be able to add your username to the sysadmin role, change authentication to mixed, and set up an sa password. – Aaron Bertrand May 22 '13 at 17:59
  • Thanks, I will give it a go as soon as I can get back on this project (too much multi tasking required today:). – geoff swartz May 22 '13 at 18:20
  • 1
    This isn't exactly a duplicate of the *question*, but the solution (recover admin access to the instance when you don't have it) is the same - possible duplicate of [Recover sa password](http://stackoverflow.com/questions/11475970/recover-sa-password) – Aaron Bertrand May 22 '13 at 18:22

0 Answers0