DROP LOGIN command in SQL Server

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

  1. Cannot delete the login account currently logged into SQL Server.
  2. If you delete the login account that the database user has mapped to, the user will be disconnected to SQL Server.
  3. 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.

Previous lesson: ALTER LOGIN command in SQL Server

The following article: Find Login in SQL Server

4 ★ | 1 Vote

May be interested

  • Find Login in SQL ServerPhoto of Find Login in SQL Server
    are there any queries in sql server that return all login accounts and information about them?
  • New points in SQL Server 2017Photo of New points in SQL Server 2017
    the sql server 2017 version is primarily connected to linux, bringing the power of sql to linux. in short, you can install sql server 2017 on linux, using sql server 2017 on linux-based docker containers. sql server 2017 also allows you to choose development languages, develop it on-premise or cloud-based.
  • The CREATE USER command in SQL ServerPhoto of The CREATE USER command in SQL Server
    this article will show you in detail how to use the create user command in sql server, with specific syntax and examples to better visualize and capture commands.
  • Instructions for installing SQL Server 2017 step by stepPhoto of Instructions for installing SQL Server 2017 step by step
    sql server 2017 comes with new features in the installation process. it now supports the machine learning service for r and python. it also includes ssis scale out master and scale out worker.
  • DROP USER command in SQL ServerPhoto of DROP USER command in SQL Server
    this article will show you in detail how to use the drop user command in sql server with specific syntax and examples to better visualize and capture commands.
  • Find User in SQL ServerPhoto of Find User in SQL Server
    do any queries on sql server return all user created?