Wednesday 3 April 2013

CRM 2011 database sql investigation

--List down the name of solutions and entity/form where this label is used.
select
FriendlyName, LocalizedLabel.* from [LocalizedLabel]
inner join Solution on LocalizedLabel.SolutionId = Solution.SolutionId where LocalizedLabelId = 'localised label id'

--Published Form Xml
select FriendlyName,SystemForm.* from SystemForm inner join Solution on SystemForm.SolutionId = Solution.SolutionId where FormId = 'formid'

--Form Xml exists in solution
select FriendlyName,SystemFormBase.* from SystemFormBase inner join Solution on SystemFormBase.SolutionId = Solution.SolutionId where FormId = 'form id'

--List down the Form Xml for the solution which matches the published formxml solution

select
FriendlyName,SystemFormBase.* from SystemFormBase inner join Solution on SystemFormBase.SolutionId = Solution.SolutionId inner join SystemForm on SystemForm.FormXml = SystemFormBase.FormXml where SystemForm.FormId = 'form id'