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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

how to know which entity does the sql table refer to?

(0) ShareShare
ReportReport
Posted on by 197

Hello,

I have an access to the database of the crm and I have a table.

I don't know what entity does that table reference.

And I don't know how to find it out.

Google search was useless.

Can you help me ?

Thanks.

I have the same question (0)
  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    Thank you for your query.

    You can query EntityAsIfPublsihed view to get Entity name:

    --Find by Base Table
    SELECT
    [Name] EntityName,
    ObjectTypeCode,
    BaseTableName
    
    FROM EntityAsIfPublishedView
    WHERE BaseTableName= 'AccountBase'
    
    
    --Find by Logical Name (logical name= entity view name)
    SELECT
    [Name] EntityName,
    ObjectTypeCode,
    BaseTableName
    
    FROM EntityAsIfPublishedView
    WHERE LogicalName= 'account'
    

  • magical Khachapuri Profile Picture
    197 on at

    Table 'EntityAsIfPublishedView' doesn't exist

  • Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    It is not a table, it is a view which is build on Entity object.

    You can also query Entity object.

  • Inogic Profile Picture
    682 on at

    Hi,

    In Dynamics 365 CE, each entity has a SQL table, is created in “YourOrganizationName_MSCRM” database.

    The table name for entity is same as entity name (Logical Name/Schema Name. as SQL server is case insensitive) with suffix “Base”.

    Example -

    1. Account entity table name is dbo.AccountBase
    2. For custom entity, custom entity table name is dbo.EntityLogicalNameBase

     

    Also along with SQL table, CRM creates filtered SQL views for entities (except some system entities). Security is embedded in the filtered view. 

    Example -

    1. Filtered view for Account entity -  dbo.FilteredAccount
    2. Filtered view for custom entity -  dbo.FilteredEntityLogicalName

     

    Hope this help.

     

    Thanks!

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans