Requirement: Delete Microsoft Dynamics CRM Organization
Solution: We can follow below steps to delete Dynamics CRM Organization from DB.
This will delete organization DB , but we also need to remove Organization references from MSCRM_CONFIG DB, so follow below steps.
select * from [dbo].Organization
delete from [dbo].[OrganizationFeatureMap] where OrganizationId=’ORG_GUID’
delete from [dbo].SystemUserOrganizations where OrganizationId=’ORG_GUID’
delete from [dbo].[OrganizationProperties] where Id=’ORG_GUID’
delete from [dbo].Organization where DatabaseName=’ORGNAME_MSCRM’
Note: This is an unsupported method of removing Organization DB and should be used only when not able to delete organization from Deployment Manager for specific reasons.
Hope it will help someone !!