We help IT Professionals succeed at work.

SQL Query - Script to find database security users

holemania
holemania asked
on
Hello experts,

I'm kind of at a loss at figuring out how I can retrieve a list of users under the security folder for a specific database.  Is there a stored procedure or function I can use to do this?

Comment
Watch Question

Top Expert 2011
Commented:
do
 select * from sys.database_principals
Commented:
You can use the below query:

exec <dbname>.dbo.sp_helpuser

In the above query, replace <dbname> by the required database name.

Author

Commented:
Thank you.