How to Add the Current Admin User to SQL Server Express 2008

sqlsql-server-2008sql-server-expresswindows-server-2003

I have managed (in 'eksperiments') to remove both my Windows users from my SQL Express instance. I am now logged in as windows admin, and have re-created the corresponding SQL login, but I cannot assign sysadmin rights. I get the error:

User does not have permission to perform this action. (Microsoft SQL Server, Error: 15247)

If admin can't do this, should I start looking for a small animal to sacrifice?

Best Answer

It is possible that your Windows admin account doesn't have admin rights - it depends what you set up. You'll need to login with an account that does have rights, or, log in as the sa user.

If you don't have SQL authentication enabled you can activate it with a registry tweak. I think this is the right key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<<instance name>>\MSSQLServer\Loginmode

It should be set to mixed mode (2) but of course you still need to know what the sa password was when you installed the instance.

Related Topic