There are different tables in the backend which connects Dimensions and members together.
1. Dim Table - This gives you dimension Name and Dim type id.

2. Member Table -

3. Relationship Table -

You can write a sql query using the data adapter to output the records.
Below example to extract unique members.
SELECT
Member.MemberId,
Member.Name,
FROM
Relationship
RIGHT OUTER JOIN Member
ON Relationship.DimTypeId = Member.DimTypeId AND Relationship.ParentId = Member.MemberId
WHERE
(Member.DimTypeId = 0) AND (Relationship.ParentId IS NULL)
ORDER BY
Member.Name
If the answer helped you , Please give kudos and mark the solution as accepted answer 😊