Udostępnij przez


xp_grantlogin (Transact-SQL)

Udziela dostępu systemu Windows grupy lub użytkownika, w celu SQL Server.

Important noteImportant Note:

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Użycie TWORZENIE IDENTYFIKATORA LOGOWANIA zamiast niego.

Topic link iconKonwencje składni języka Transact-SQL

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

Argumenty

  • [ @loginame = ] 'login'
    Jest nazwą użytkownika systemu Windows lub grupy, które mają zostać dodane.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.Tylko admin może być określony. Jeśli admin jest określony, login uzyskuje dostęp do SQL Server, a dodane jako element członkowski członkowski sysadmin stała rola serwera.

Wartości kodów powrotnych

0 (sukces) lub 1 (brak)

Remarks

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

Uprawnienia

Członkostwo w grupie wymaga securityadmin stała rola serwera.Przy zmianie logintype, wymaga członkostwo w grupie sysadmin stała rola serwera.