The DROP LOGIN command is used to delete an identity (which is the Login login account) used to connect to SQL Server.
Syntax of DROP command LOGIN
DROP LOGIN ten_dangnhap;
Variable name or variable value
Username
The login name of the login account (Login) needs to be deleted.
Note
- Cannot delete the login account currently logged into SQL Server.
- If you delete the login account that the database user has mapped to, the user will be disconnected to SQL Server.
- See also the CREATE LOGIN and ALTER LOGIN commands.
For example
DROP LOGIN quantrimang;
For example, the DROP LOGIN command above will delete the login account quatrimang. This command can only run if quantrimang is currently not logged in. Otherwise, this command will fail.