Categories: Uncategorized

Dynamics CRM: SQL to Get CRM Metadata in 2011 & 2013

Occasionally, I need (or want – depending on your preference) a list of all the attributes (basic CRM metadata) in a Dynamics CRM organization. While there are several ways, including some great document generators, that will get such a list for you, SQL is always an option. If you are on-premises, or working in a developer VM, you can run this query against a CRM organization database to get the basic details. It can also be used as a starter for more complicated metadata query requirements.

SELECT		en.LogicalName
      , en.ObjectTypeCode
      , att.LogicalName
      , typ.Description
      , typ.XmlType
FROM		MetadataSchema.Entity en
        JOIN MetadataSchema.Attribute att on en.EntityId = att.EntityId
        JOIN MetadataSchema.AttributeTypes typ on att.AttributeTypeId = typ.AttributeTypeId
ORDER BY	en.LogicalName
      , att.LogicalName
Nicolas Nowinski

Share
Published by
Nicolas Nowinski

Recent Posts

With AI, Written Language Matters Most

I'm not 100% certain I love this article. I made myself write it in less…

2 months ago

Can AI predict weather? AI’s DC Snow Forecast

I had a little fun a few days ago having AI do some forecasting for…

3 months ago

What the snow? AI Chatbots Predicting DC Weather!

Can AI Chatbots predict DC snow weather? I decided to try it out by letting…

3 months ago

History Does Not Predict the Future

History is far less useful than many assume. It creates the illusion of predictability only…

3 months ago

10 Choices for a Better Future No Matter What Happens

I'm not a fan of traditional New Years Resolutions, as I wrote about here, but…

3 months ago

The Human Blind Spot Around Non-Deterministic Machines

Why LLM's will always make mistakes and we shouldn't call them hallucinations I saw a…

7 months ago