How to Enable / Disable a user in MS SQL Server

To Enable or Disable a User in MS SQL Server:

There are two ways to Enable / Disable a user in MS SQL Server

1. Using TSQL

  • To Enable a User: 
use master
go
ALTER LOGIN [UserName] ENABLE
go

  • To Disable a User: 

use master
go
ALTER LOGIN [UserName] DISABLE
go

2. Using SQL Server Management Studio GUI:

  • Open SQL Server Management Studio, go to object explorer and expend logins folder as in the below image: 

























  • Double click on desired user / login or right click and go to properties as in the below image:
























  • Click on Status and Enable / Disable user / login as in the below image:


Comments

Popular posts from this blog

How to Create a Database in MS SQL Server

How to Import / Export Data in Oracle