sp_logininfo

(Windows only) Displays all roles granted to Windows users and groups with sp_grantlogin.

Syntax

sp_logininfo ["login_name" | "group_name"]

Parameters

Examples

Usage

There are additional considerations when using sp_logininfo:
  • sp_logininfo displays all roles granted to Windows users and groups with sp_grantlogin.

  • You can omit the domain name and domain separator (\) when specifying the Windows user name or group name.

See also grant, setuser in Reference Manual: Commands.

Permissions

The permission checks for sp_logininfo differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be a user with manage roles privilege.

Disabled

With granular permissions disabled, you must be a user with sa_role.

Auditing

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

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • 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

Related reference
sp_displaylogin
sp_grantlogin
sp_revokelogin
sp_role
sp_who