xp_grantlogin

Transact-SQL Reference

Transact-SQL Reference

xp_grantlogin

Grants a Microsoft® Windows NT® group or user access to Microsoft SQL Server™. xp_grantlogin is provided for backward compatibility. Use sp_grantlogin.

Syntax

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

Arguments

[@loginame =] 'login'

Is the name of the Windows NT user or group to be added. The Windows NT user or group must be qualified with a Windows NT 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 SQL Server, 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 rather than an extended stored procedure and calls sp_grantlogin to grant a Windows NT-based group or user access to SQL Server.

See Also

sp_denylogin

sp_grantlogin

System Stored Procedures (General Extended Procedures)

xp_enumgroups

xp_loginconfig

xp_logininfo

sp_revokelogin