Reports information about a particular user, group, or alias, or about all users, in the current database.
sp_helpuser [name_in_db]
is the user’s name in the current database.
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
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
sp_helpuser reports information about all users of the current database. If you specify a name_in_db, sp_helpuser reports information on the specified user only.
If the specified user is not listed in the current database’s sysusers table, sp_helpuser checks to see if the user is aliased to another user or is a group name.
Any user can execute sp_helpuser.
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 |
|
System procedures sp_adduser, sp_dropuser, sp_helpgroup