블로그는 나의 힘!
[ Programing ]/Database2021. 3. 30. 09:33

SELECT @@Servername as ServerName, db_name() as DBName,_role.Name, _role.Type_Desc as RDesc, Members.Name MemberName, Members.Type_Desc as MDesc
FROM sys.database_role_members _roleMember
INNER JOIN sys.database_principals _role ON _role.Principal_Id = _roleMember.Role_Principal_Id
INNER JOIN sys.database_principals Members ON Members.Principal_Id =_roleMember.Member_Principal_Id

Posted by Mister_Q