Search code examples
sql-serverdynamics-crm-2011dynamics-crm

dynamics crm role sql


Good day. Trying to create a view in MS SQL that retrieves user data MS Dynamics CRM. I just need to extract the name of the employee and to correlate it with the identifier of one particular group. But the problem is that I can not find a relation with the security roles. Please give an example.


Solution

  • The table you are looking for is SystemUserRoles

    select systemuser.firstname, systemuser.lastname, role.name, role.*
    from systemuser
    join SystemUserRoles on systemuser.systemuserid = systemuserroles.SystemUserId
    join [role] on systemuserroles.roleid = [role].roleid