Last active
December 19, 2015 00:39
-
-
Save gotdibbs/5870067 to your computer and use it in GitHub Desktop.
Check users against MSCRM_CONFIG database for invalid user id error #sql #crm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use [ORGANIZATIONNAME_MSCRM]; | |
select crm.FullName | |
from SystemUser crm | |
where crm.IsDisabled = 0 | |
and not exists | |
( | |
select crm.SystemUserId | |
from MSCRM_CONFIG.dbo.SystemUserOrganizations config | |
join MSCRM_CONFIG.dbo.Organization org | |
on org.Id = config.OrganizationId | |
where crm.SystemUserId = config.CrmUserId | |
) | |
order by crm.FullName asc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment