Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 1.94 KB

File metadata and controls

62 lines (45 loc) · 1.94 KB
title 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/23/2025
ms.service sql
ms.subservice system-objects
ms.topic reference
f1_keywords
xp_revokelogin
xp_revokelogin_TSQL
helpviewer_keywords
xp_revokelogin
dev_langs
TSQL

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

xp_revokelogin { [ @loginame = ] 'login' }

Arguments

[ @loginame = ] 'login'

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