sp_grantlogin

Description

(Windows only) Assigns Adaptive Server roles or default permissions to Windows users and groups when Integrated Security mode or Mixed mode (with Named Pipes) is active.

Syntax

sp_grantlogin {login_name | group_name} 
	["role_list" | default]

Parameters

login_name

is the network login name of the Windows NT user.

group_name

is the Windows NT group name.

role_list

is a list of the Adaptive Server roles granted. The role list can include one or more of the following role names: sa_role, sso_role, oper_role. If you specify more than one role, separate the role names with spaces, not commas.

default

specifies that the login_name or group_name receive default permissions assigned with the grant statement or sp_role procedure.

Examples

Example 1

Assigns the Adaptive Server oper_role to the Windows NT user “jeanluc”:

sp_grantlogin jeanluc, oper_role

Example 2

Assigns the default value to the Windows NT user “valle”. User “valle” receives any permissions that were assigned to her via the grant command or sp_role procedure:

sp_grantlogin valle

Example 3

Assigns the Adaptive Server sa_role and sso_role to all members of the Windows NT administrators group:

sp_grantlogin Administrators, "sa_role sso_role"

Usage

Permissions

Only a system administrator can execute sp_grantlogin.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

Event

Audit option

Command or access audited

Information in extrainfo

38

exec_procedure

Execution of a procedure

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

See also

Commands grant, setuser

System procedures sp_addlogin, sp_displaylogin, sp_droplogin, sp_locklogin, sp_logininfo, sp_modifylogin, sp_revokelogin, sp_role