Reports information about the users of a database.
sp_helpuser [username]
where
If the specified user is not listed in the current database's sysusers table, the procedure checks to see if the user has an alias to another user or is a group name.
This example displays information about all users in the current database.
sp_helpuser go
Users_name |
ID_in_db |
Group_name |
Login_id |
Default_db |
----------- |
-------- |
------------ |
---------- |
------------ |
ann |
4 |
hackers |
ann |
master |
dbo |
1 |
public |
sa |
master |
guest |
2 |
public |
NULL |
NULL |
judy |
3 |
hackers |
judy |
master |
This example displays information about the database owner.
sp_helpuser dbo
Execute permission defaults to the public group.
master.dbo.syslogins, sysalternates, sysusers
GRANT statement | sp_help |
REVOKE statement | sp_helpgroup |
sp_adduser | USE statement |
sp_dropuser |