Get All Entities and Attributes in CRM solution
select
en.logicalname as 'EntityName',
av.logicalname as 'AttributeName'
from attributeview as av
left join entityview en on av.entityid = en.entityid
left join solutioncomponent as sc on av.entityid = sc.objectid
where sc.solutionidName='CRMConnector'