web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Column Mapping within SQL

(0) ShareShare
ReportReport
Posted on by

Hi all,

I am trying to get a list of the field names (as they exist on the form) and what database column name that relates to.  A little bit like the screen you get on advanced find when you are selecting the columns you require.

So far i have this

select TargetAttributeName, SourceAttributename,*
from [dbo].[ColumnMapping]
where targetEntityName = 'Contact'
and targetAttributeName like '%state%'

But it seems that i am getting lots of results - and i am thinking perhaps this isnt the correct table (this seems to be something to do with exports?).  Could someone point me in the correct direction for the right table.

Thanks in Advance.

Dan

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    BackToTheCrm Profile Picture
    on at

    Hello Dan,

    You can use the Metadata Document Generator tool from XrmToolbox (http://www.xrmtoolbox.com/)

    The Schema Name is the name of the field in the SQL DB.

  • Community Member Profile Picture
    on at

    Hi,

    I don't think I have the required access to the front end for an application like that.  I have access to a copy of the database used for reporting that I need to try to find that information from.

    Thanks anyway,

    Dan

  • Verified answer
    BackToTheCrm Profile Picture
    on at

    Dan,

    Use this SQL query :

    SELECT e.Name as EntityName
          ,a.Name as LogicalName
          ,a.PhysicalName
          ,ll.Label AS DisplayName
      FROM [dbo].EntityView e
    
        INNER JOIN [dbo].AttributeView a 
        on e.EntityId = a.EntityId
        AND a.TableColumnName IS NOT NULL
    
        INNER JOIN LocalizedLabelView ll
        ON ll.ObjectId = a.AttributeId
        AND ObjectColumnName = 'DisplayName'
        AND LanguageId = 1033 -- English
    
    ORDER BY e.name, a.Name


    If the database language is not English replace 1033 by the correct LCID.

  • Suggested answer
    Community Member Profile Picture
    on at

    That is absolutely perfect.  Thank you so much!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans