Tuesday, December 8, 2009

Enable Login

SQL SERVER – Enable Login – Disable Login for specific user
In SQL SERVER 2005, all the login (including ’sa’ ) can be enabled and disabled using ALTER LOGIN command.

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

No comments:

Post a Comment