Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 3.28 KB

File metadata and controls

64 lines (50 loc) · 3.28 KB
title xp_grantlogin (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
xp_grantlogin
xp_grantlogin_TSQL
dev_langs
TSQL
helpviewer_keywords
xp_grantlogin
ms.assetid c851c1ab-3b29-4b99-9902-78c2665a844b
author VanMSFT
ms.author vanto

xp_grantlogin (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx-md]

Grants a Windows group or user access to [!INCLUDEssNoVersion].

Important

[!INCLUDEssNoteDepFutureAvoid] Use CREATE LOGIN instead.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
xp_grantlogin {[@loginame = ] 'login'} [,[@logintype = ] 'logintype']  

Arguments

[ @loginame = ] 'login' Is the name of the Windows user or group to be added. The Windows user or group must be qualified with a Windows domain name in the form Domain\User. login is sysname, with no default.

[ @logintype = ] 'logintype' Is the security level of the login being granted access. logintype is varchar(5), with a default of NULL. Only admin can be specified. If admin is specified, login is granted access to [!INCLUDEssNoVersion], and added as a member of the sysadmin fixed server role.

Return Code Values

0 (success) or 1 (failure)

Remarks

xp_grantlogin is now a system stored procedure instead of an extended stored procedure. xp_grantlogin calls sp_grantlogin and sp_addsrvrolemember.

Permissions

Requires membership in the securityadmin fixed server role. When changing the logintype, requires membership in the sysadmin fixed server role.

See Also

sp_denylogin (Transact-SQL)
sp_grantlogin (Transact-SQL)
System Stored Procedures (Transact-SQL)
General Extended Stored Procedures (Transact-SQL)
xp_enumgroups (Transact-SQL)
xp_loginconfig (Transact-SQL)
xp_logininfo (Transact-SQL)
sp_revokelogin (Transact-SQL)