Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DROP LOGIN (Transact-SQL)
Collapse the table of content
Expand the table of content

DROP LOGIN (Transact-SQL)

 

Applies To: SQL Server 2014, SQL Server 2016 Preview

Removes a SQL Server login account.

Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database, Azure SQL Data Warehouse Public Preview.

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 Troubleshoot Orphaned Users (SQL Server).

Requires ALTER ANY LOGIN permission on the server.

The following example drops the login WilliJo.

DROP LOGIN WilliJo;
GO  

Community Additions

ADD
Show:
© 2015 Microsoft