In SQL SERVER, database username can be enabled and disabled using ALTER LOGIN command. In this post, I share how to Enable, Disable, Change username SA in SQL Server.
When you install SQL Server with mixed-mode authentication, the sa login is created automatically by default. But when using Windows authentication only, this database administrative account is disabled. SA is an database administrative account that has full access to, and complete control of, the SQL Server instance and all of its databases. For additional security (prevent educated guess from hackers) the name of the sa account can be changed some time.
To disable
sa login, use the command:
1 2 3 4 |
ALTER LOGIN sa DISABLE GO |
1 2 3 4 |
ALTER LOGIN sa ENABLE GO |
1 2 3 4 |
ALTER LOGIN [sa] WITH NAME = [Ahmed] GO |
Leave a Comment