| title | sp_droplogin (Transact-SQL) | ||
|---|---|---|---|
| description | sp_droplogin removes a SQL Server login. | ||
| author | markingmyname | ||
| ms.author | maghan | ||
| ms.reviewer | randolphwest | ||
| ms.date | 06/23/2025 | ||
| ms.service | sql | ||
| ms.subservice | system-objects | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
[!INCLUDE SQL Server]
Removes a [!INCLUDE ssNoVersion] login, which prevents access to an instance of [!INCLUDE ssNoVersion] under that login name.
Important
[!INCLUDE ssNoteDepFutureAvoid] Use DROP LOGIN instead.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_droplogin [ @loginame = ] N'loginame'
[ ; ]
The login to be removed. @loginame is sysname, with no default. @loginame must already exist in [!INCLUDE ssNoVersion].
0 (success) or 1 (failure).
sp_droplogin calls DROP LOGIN.
sp_droplogin can't 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 [!INCLUDE ssNoVersion]. This method is preferred.
DROP LOGIN Victoria;
GO