Using SQL Server 2005 how to find a user or login that has the db_owner role in any database?

You can replace the ‘db_owner’ with other fixed database roles such as db_accessadmin, db_backupoperator, db_datareader, db_datawriter, db_ddladmin, db_denydatareader, db_denydatawriter and db_securityadmin using the below instruction:

select user_name(member_principal_id) from sys.database_role_members where role_principal_id = user_id(‘db_owner’)


Leave a comment

Your email address will not be published.