This documentation is archived and is not being maintained.

DROP LOGIN (Transact-SQL)

Removes a SQL Server login account.

Topic link icon Transact-SQL Syntax Conventions


DROP LOGIN login_name

login_name

Specifies the name of the login to be dropped.

A login cannot be dropped while it is logged in. A login that owns any securable, server-level object, or SQL Server Agent job cannot be dropped.

You can drop a login to which database users are mapped; however, this will create orphaned users. For more information, see Troubleshooting Orphaned Users.

Requires ALTER ANY LOGIN permission on the server.

The following example drops the login WilliJo.

DROP LOGIN WilliJo;
GO  
Show: