sp_helpuser

Description

Reports information about a particular user, group, or alias, or about all users, in the current database.

Syntax

sp_helpuser [name_in_db]

Parameters

name_in_db

is the user’s name in the current database.

Examples

Example 1

Displays information about all users in the current database:

sp_helpuser
Users_name ID_in_db    Group_name  Login_name 
---------  --------    ----------  ---------- 
ann        4           hackers     ann 
dbo        1           public      sa 
guest      2           public      NULL 
judy       3           hackers     judy

Example 2

Displays information about the Database Owner (user name “dbo”):

sp_helpuser dbo
Users_name     ID_in_db    Group_name  Login_name
----------     --------    ----------  ---------- 
dbo            1           public      sa 
Users aliased to user. 
Login_name
------------------------------- 
andy
christa
howard
linda 

Usage

Permissions

Any user can execute sp_helpuser.

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

System procedures sp_adduser, sp_dropuser, sp_helpgroup