xp_grantlogin (Transact-SQL)
Applies to: SQL Server
Grants a Windows group or user access to SQL Server.
Important
This feature will be removed in a future version of SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use CREATE LOGIN instead.
Transact-SQL syntax conventions
Syntax
xp_grantlogin { [ @loginame = ] 'login' } [ , [ @logintype = ] 'logintype' ]
Arguments
[ @loginame = ] 'login'
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>
. @loginame is sysname, with no default.
[ @logintype = ] 'logintype'
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, @loginame 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 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. Changing the @logintype requires membership in the sysadmin fixed server role.
Related content
प्रतिक्रिया
https://aka.ms/ContentUserFeedback.
जल्द आ रहा है: 2024 के दौरान हम सामग्री के लिए फीडबैक तंत्र के रूप में GitHub मुद्दों को चरणबद्ध तरीके से समाप्त कर देंगे और इसे एक नई फीडबैक प्रणाली से बदल देंगे. अधिक जानकारी के लिए, देखें:के लिए प्रतिक्रिया सबमिट करें और देखें