Skip to content
Mohamed Mostafa's Blog

Mohamed Mostafa's Blog

Microsoft Dynamics 365, Microsoft Power Platform, Power Apps, Power Virtual Agents PVA, Azure, Artificial Intelligence, AI Chat Bots, Portals and Microsoft Platform thoughts, issues, resolutions, tips and community content free to all!

Month: April 2012

Posted on 7 April 20124 October 2013

Retrieve and Export Microsoft Dynamics CRM 2011 Database Schema and MetaData to Excel

It’s often required to retrieve Microsoft Dynamics CRM 2011 Database Schema and also to browse, view and edit Dynamics CRM MetaData including each entity, attributes (fields – database columns) and entities relationship (1 to Many, Many to 1 and Many to Many) then export this to an excel sheet or other forms of documentation.

To do this, you have several tools and ways. I’ll quickly list some of them in this post:

Option 1: Use the Microsoft Dynamics CRM SDK MetaData Browser tool. This comes as part of the SDK under the Tools folder when you unpack the latest CRM SDK. To use this tool, you need to import the managed solution that you can find in the MetaData browser folder and open the managed solution after importing then click on configuration.

Option 2: Use the Dynamics CRM Tools MetaData Browser and exporter to Excel available at CodePlex: http://crm2011metabrowser.codeplex.com/

This tool allows you to export to excel but it doesn’t allow exporting the whole database to excel but rather entity by entity (as far as I can see).

Option 3: It’s my preferred method which is using the old trick of writing an SQL Query that returns Dynamics CRM 2011 database schema. You can obviously change in this query to add or remove more database columns in the returned results or getting the result in a different format.

Here is the SQL query:

SELECT  EntityView.Name AS EntityName, LocalizedLabelView_1.Label 
AS EntityDisplayName, AttributeView.Name AS AttributeName, LocalizedLabelView_2.Label 
AS AttributeDisplayName,AttributeTypes.Description as Type, AttributeTypes.XmlType,AttributeView.Length,Accuracy,IsCustomEntity,
IsMappable,EntityView.IsCustomizable,
EntityView.IsRenameable,IsActivity,AttributeView.IsCustomField 
FROM    LocalizedLabelView AS LocalizedLabelView_2
INNER JOIN  AttributeView ON LocalizedLabelView_2.ObjectId = AttributeView.AttributeId
RIGHT OUTER JOIN  EntityView INNER JOIN LocalizedLabelView AS LocalizedLabelView_1
ON EntityView.EntityId = LocalizedLabelView_1.ObjectId 
ON AttributeView.EntityId = EntityView.EntityId
INNER JOIN attributetypes on AttributeView.AttributeTypeId = AttributeTypes.AttributeTypeId
WHERE LocalizedLabelView_1.ObjectColumnName = 'LocalizedName' 
AND LocalizedLabelView_2.ObjectColumnName = 'DisplayName'
AND LocalizedLabelView_1.LanguageId = '1033' 
AND LocalizedLabelView_2.LanguageId = '1033'
ORDER BY EntityDisplayName, AttributeName

 

Please comment below if you have done a better/different query or if you are having issues with this one.

Thanks!

Mohamed Mostafa

Share this:

  • Share
  • Twitter
  • LinkedIn
  • Email
  • Print
  • Facebook
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket

Like this:

Like Loading...
Authorised Microsoft Dynamics CRM Community Blog

Follow me on Twitter!

Tweets by @MIM_CRM

Top Posts

  • You can now connect bots to phone call interactions with Dynamics 365 Customer Service
  • New Microsoft Power Platform ISV Experiences for Independent Software Vendors
  • New Microsoft AI Builder Features list and their release dates including AI Builder Features General Availability dates
  • Microsoft AI Builder new capabilities as part of Power Platform Fall 2021 Wave 2 Release
  • Microsoft Dynamics 365 Voice channel added to D365 Omnichannel
  • 6 Months FREE Microsoft Dynamics 365 Customer Service Licences, Power Apps, Power Automate, Power Apps Portal and Power Virtual Agents due to Corona & COVID-19
  • Due to Coronavirus and COVID-19, Microsoft will relax the deadline for deprecating legacy web client by two months to December 2020
  • Announcing the deprecation of Microsoft Dynamics 365 CRM Outlook COM Add-in for D365 Online

Most recent comments

  • Adx Community Portal - LoginWave on Difference between Microsoft Dynamics CRM Portals, ADX Studio, Portals from Microsoft, XRM Portals and Open Source Dynamics Portal
  • Vasadi Prasad on Hide Areas & Sub Areas in the SiteMap using Security Roles in Dynamics CRM (Privilege tag)
  • How to Fully Automate Email Tracking Through D365 Outlook - Formus Professional Software on Automatically Track All Incoming and Outgoing Email Messages in Dynamics 365 with Exchange Online Rules (Abridged Version)
  • Mohamed Mostafa on Dynamics CRM 2011 User and System Dashboards Usage and Security introduction
  • Mohamed Mostafa on Dynamics CRM Entity and Field Display Name, Field Schema Name and Field Logical name or Attribute name

RSS Feeds

  • RSS – Posts
  • RSS – Comments

RSS Unknown Feed

RSS Unknown Feed

RSS Unknown Feed

Recent posts on my favourite blogs:

  • Why I’m Planning to spend time listening to Microsoft Frontier Transformation Week Sessions.
  • Microsoft 365 Copilot (s)
  • How to Disable and Turn Off – Draft with Copilot on Dynamics 365 Emails
  • PDF not displaying in preview an attachment in the Dynamics 365 timeline
  • Using the Lookup function to create reports on multiple DataSets
  • Solution Layers
  • Customizing Charts using XML – Part 1
  • Selecting a Mail Merge Addon for Microsoft Dynamics CRM 2011

Tags & Posts

  • #Announcement
  • #LearnDyn365
  • #Learning
  • #Mentoring
  • #MSDynCRM
  • .NET
  • API
  • Azure
  • Book Review
  • CRM
  • CRM 2011
  • CRM 2013
  • CRM 2015
  • Custom Entity
  • Dynamics
  • Dynamics 365
  • Dynamics365
  • Dynamics CRM
  • Entity
  • Error
  • Event Log
  • Field
  • GDPR
  • Integration
  • Internet Explorer
  • JavaScript
  • Microsoft
  • Microsoft Dynamics CRM
  • MSDyn365
  • New Features
  • Outlook
  • PowerApps
  • PowerPlatform
  • Reporting Services
  • Report Server
  • SCRIBE
  • Scribe Console
  • Scribe CRM Adaptor
  • script
  • SDK
  • SQL Server
  • Videos
  • WCF
  • Web Service
  • what's new

Archives

  • February 2022
  • January 2022
  • September 2021
  • August 2021
  • September 2020
  • March 2020
  • February 2020
  • January 2020
  • November 2019
  • October 2019
  • June 2019
  • May 2019
  • March 2019
  • November 2018
  • October 2018
  • August 2018
  • July 2018
  • May 2018
  • March 2018
  • February 2018
  • January 2018
  • October 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • November 2016
  • August 2016
  • July 2016
  • June 2016
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • September 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
Proudly powered by WordPress
%d bloggers like this: