How to Enable and Disable Login in SQL Server



Enable and Disable Login by Command Line:
Enable Login:
USE [master]
GO 
DENY CONNECT SQL TO [SAMBA\A82893]
GO
 ALTER LOGIN [SAMBA\A82893] ENABLE
GO

Disable Login:
USE [master]
GO 
DENY CONNECT SQL TO [SAMBA\A82893]
GO
 ALTER LOGIN [SAMBA\A82893] DISABLE
GO
Comments