Home > front end >  Not Able to Enable sa Account in SQL Server 2019 Express after Login with Windows Authentication Mod
Not Able to Enable sa Account in SQL Server 2019 Express after Login with Windows Authentication Mod

Time:01-26

I have installed SQL Server Express 2019 on my machine and after installation, I am able to login into server using the Windows Authentication method like

enter image description here

And as you can see the sa account has been disabled by default

enter image description here

So I tried to enable the sa account like

enter image description here

But I am getting this error message

enter image description here

Cannot alter the login 'sa', because it does not exist or you do not have permission.(Microsoft SQL Server, Error:15151)

Even when I tried to change the server authentication mode from Windows Authentication mode to SQL Server and Windows Authentication mode at

enter image description here

I am facing this error!

enter image description here

The EXECUTE permission was denied on the object 'xp_instance_regwrite', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error; 229)

So it looks like I have no/not granted any permission to do any anything! when login with Windows which apparently is my only option to get into server!(this is also happening when I tried to create new user!)

Can you please let me know what I am doing wrong and how I can handle this to act as an administrator for DB when I login?

I have already seen and tried this post, so please kindly, if you are not sure about the solution do not close, down vote or redirect me again to this post?

CodePudding user response:

This is poor practice in the first place. If you need a local admin account you should create a different login such that attackers and automated tools won't be able to just assume the user name.

But remember: I said, "If". You can get admin/sa rights to administer the server (or create your initial local login) by logging into the computer (not the database) with the local administrator account. Then you can use using Windows Authentication from that account to access the database server as a server administrator.

  • Related