In SQL SERVER 2005, all the login (including ‘sa’ ) can be enabled and disabled using ALTER LOGIN command. This is a very popular request quite a lot of time as a user want to secure their system administrator’s account ‘SA’. The best possible scenario is either to disable SA username or change it to some new username.
In this blog post we will learn how we can disable the SA login or disable the same. In this blog post we will also see that we can change the SA to a new name. Make sure that you change the new name in such fashion that users can’t guess them easily.
To disable ‘sa’ login:
ALTER LOGIN sa DISABLE GO
To enable ‘sa’ login:
ALTER LOGIN sa ENABLE GO
Also for additional security (prevent educated guess from hackers) the name of the ‘sa’ account can be changed.
ALTER LOGIN [sa] WITH NAME = [AdminUser] GO
Well, that’s it. I can tell you that most of the database out there has either SA enabled with a simple password. It is our responsibility that we change the SA user to another name so potentially bad people can’t guess it easily.
Please leave your views in the comments section.
Reference: Pinal Dave (https://blog.sqlauthority.com)