Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 1.96 KB

File metadata and controls

63 lines (46 loc) · 1.96 KB
title sys.xp_revokelogin (Transact-SQL)
description Revokes access from a Windows group or user to SQL Server.
author VanMSFT
ms.author vanto
ms.reviewer randolphwest
ms.date 06/19/2026
ms.service sql
ms.subservice system-objects
ms.topic reference
f1_keywords
xp_revokelogin
xp_revokelogin_TSQL
helpviewer_keywords
xp_revokelogin
dev_langs
TSQL

sys.xp_revokelogin (Transact-SQL)

[!INCLUDE SQL Server]

Revokes access from a Windows group or user to [!INCLUDE ssNoVersion].

Important

[!INCLUDE ssNoteDepFutureAvoid] Use DROP LOGIN instead.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

sys.xp_revokelogin [ @loginame = ] N'loginame'
[ ; ]

Arguments

[ @loginame = ] N'loginame'

The name of the Windows user or group from which to revoke access. @loginame must include the domain name, for example [CONTOSO\sylvester1]. @loginame is sysname, with no default.

Return code values

0 (success) or 1 (failure).

Remarks

Use DROP LOGIN instead.

Permissions

Requires ALTER ANY LOGIN permission on the server.

Related content