In this post explains how to use the SQL Server DROP LOGIN statement with syntax and examples.
The DROP LOGIN statement is used to remove an identity (ie: Login) used to connect to a SQL Server instance.
The syntax for the DROP LOGIN statement in SQL Server (Transact-SQL) is:
The name of the Login to remove.
Let's look at an example that shows how to use the DROP LOGIN statement in SQL Server (Transact_SQL).
For example:
This DROP LOGIN example would drop the Login called AODBA. This DROP LOGIN statement will only run if AODBA is not currently logged in. If AODBA is currently logged into SQL Server, the DROP LOGIN statement will raise an error.