在mscrm中,如果想查询一条记录共享给了哪些人,需要用到PrincipalObjectAccess 表,sql如下:
1 select u.FullName,a.RC_name,sup.SystemUserId,POA.ObjectId from PrincipalObjectAccess POA inner 2 join SystemUserPrincipals sup on POA.PrincipalId = sup.PrincipalId 3 inner join SystemUserBase u 4 on sup.SystemUserId=u.SystemUserId 5 inner join Rc_importList a 6 on a.Rc_importListId=POA.ObjectId 7 where POA.objecttypecode=10004 8 AND ((POA.AccessRightsMask | POA.InheritedAccessRightsMask) & 1)=1 9 and POA.ObjectId='790C63D9-56A0-E311-8A54-00188B421B2B'
附表结构