Skip to content

Instantly share code, notes, and snippets.

@JohnLBevan
Created February 4, 2015 11:59
Show Gist options
  • Select an option

  • Save JohnLBevan/183732b7145e76fcded9 to your computer and use it in GitHub Desktop.

Select an option

Save JohnLBevan/183732b7145e76fcded9 to your computer and use it in GitHub Desktop.
Export Dynamics AX 2012 Security
SELECT UI.Name, UI.ID, SR.AOTName, SRC.DATAAREA
FROM HarmonyLive.dbo.SecurityUserRole UR
LEFT JOIN HarmonyLive_Model.dbo.SecurityRole SR ON SR.RecId = UR.SecurityRole
LEFT JOIN HarmonyLive.dbo.UserInfo UI ON UI.Id = UR.User_ and UI.PARTITION = UR.PARTITION
left join HarmonyLive.dbo.SecurityUserRoleCondition SRC on SRC.SECURITYUSERROLE = UR.RECID and SRC.PARTITION = UR.PARTITION
WHERE UI.Enable = '1'
ORDER BY UI.Name, SR.AOTName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment