Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Script to list roles for a database

Author  Topic 

misnole
Starting Member

5 Posts

Posted - 2011-04-12 : 15:44:13
Hi,
Does anyone know of a query that will list the users who have the db_owner role on a specific database?

Thanks,

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-04-12 : 15:50:31
SELECT USER_NAME(member_principal_id)
FROM sys.database_role_members
WHERE SCHEMA_NAME(role_principal_id)='db_owner'
Go to Top of Page

misnole
Starting Member

5 Posts

Posted - 2011-04-12 : 16:04:31
Thank you.
Go to Top of Page
   

- Advertisement -