Sql-server – SQL Server Management Studio Change User Server Roles to sysadmin

rolesql serversql-server-2008

On my local machine I have SSMS (SQL Server 2008 R2).

For user xxxx Server Roles are only public.

When I try to change it to sysadmin it throws the error:

User does not have permission to perform this action. (.Net SqlClient Data Provider)
Error Code 15247

  1. Server type (local)/SQLExpress
  2. Authentication: Windows Authentication
  3. User: ComputerName\username (disabled)
  4. Password: none (disabled)

How can I do this?

The user I am connecting with server role is: public, but Windows Admin user.

The instance is configured for mixed mode authentication, but I don't remember the password for sa. I can't change the password because I am not sysadmin.

Is there any way I can create a sysadmin user account or make my account sysadmin and get full control of my SSMS?

Best Answer

You've explained that you don't have the SA password and you're not an administrator. In that case, you're going to have to hack your way around it.

See Think Your Windows Administrators Don’t Have Access to SQL Server 2008 by Default? Think Again. by Argenis Fernandez.

That post explains how to impersonate the NT AUTHORITY\SYSTEM login using PsExec (or creating a Windows Scheduled Task running under the SYSTEM account) to create a new login for yourself. Then, you can log in via that new login, and grant your Windows account SA permissions.