| title | sp_droplogin (Transact-SQL) | Microsoft Docs | ||
|---|---|---|---|
| ms.custom | |||
| ms.date | 03/14/2017 | ||
| ms.prod | sql | ||
| ms.prod_service | database-engine | ||
| ms.reviewer | |||
| ms.technology | system-objects | ||
| ms.topic | language-reference | ||
| f1_keywords |
|
||
| dev_langs |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | e58684d1-c394-48de-906e-da6ee91100c3 | ||
| author | stevestein | ||
| ms.author | sstein |
[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx-md]
Removes a [!INCLUDEssNoVersion] login. This prevents access to an instance of [!INCLUDEssNoVersion] under that login name.
Important
[!INCLUDEssNoteDepFutureAvoid] Use DROP LOGIN instead.
Transact-SQL Syntax Conventions
sp_droplogin [ @loginame = ] 'login'
[ @loginame = ] 'login'
Is the login to be removed. login is sysname, with no default. login must already exist in [!INCLUDEssNoVersion].
0 (success) or 1 (failure)
sp_droplogin calls DROP LOGIN.
sp_droplogin cannot be executed within a user-defined transaction.
Requires ALTER ANY LOGIN permission on the server.
The following example uses DROP LOGIN to remove the login Victoria from an instance of [!INCLUDEssNoVersion]. This is the preferred method.
DROP LOGIN Victoria;
GO
Security Stored Procedures (Transact-SQL)
DROP LOGIN (Transact-SQL)
System Stored Procedures (Transact-SQL)