Dynamic CRM 查询实体记录 被共享给了 哪个用户 SQL语句

--客户表名"new_customer"  

SELECT u.FullName AS 被共享人,a.new_name AS 客户名称,sup.SystemUserid AS 共享人ID,POA.ObjectId AS 共享记录ID FROM PrincipalObjectAccess  POA inner  join SystemUserPrincipals sup on POA.PrincipalId = sup.PrincipalId  inner join SystemUserBase u  on sup.SystemUserId=u.SystemUserId inner join dbo.new_customer a  on a.new_customerId=POA.ObjectId WHERE POA.ObjectId IN (SELECT new_customerId FROM dbo.new_customer)

原文地址:https://www.cnblogs.com/lsysunbow/p/12582169.html