Below query can be used to get all database users having db owner roles in SQL Server.

DECLARE @dbname VARCHAR(50)   
DECLARE @statement NVARCHAR(MAX)
CREATE TABLE #UserPermission
(
   ServerName SYSNAME,
   DbName SYSNAME,
   UserName SYSNAME,
   TypeOfLogIn VARCHAR(50),
   PermissionLevel VARCHAR(50),
   TypeOfRole VARCHAR(50)
)
Read the rest