Monday, July 20, 2015

How to Easily Get Record Counts for Entitys in Microsoft Dynamics CRM

You can quickly get record counts for all of your entities if you need to using the RecordCountShapshot table in Dynamics CRM.  You aren't supposed to do select queries against  tables so I wouldn't recommend doing this in an integration or something like that.  But if you need a quick ball park of how many records are in each table, it's not a bad option.


SELECT TOP 1000 [Count]

,[RecordCountSnapshotId]

,entityview.ObjectTypeCode, Name

FROM [TESTCRM_MSCRM].[dbo].[RecordCountSnapshot] , EntityView where entityview.ObjectTypeCode = RecordCountSnapshot.ObjectTypeCode

and count > 0 order by count desc

Here is what the results look like:



-Happy Monday!!

3 comments:

  1. How to write an assignment clear all your doubts regarding assignment writing. It is a daily task in each and every school and colleges. Children need help to write their assignments.

    ReplyDelete
  2. Hello! Thank you for sharing this method, I just needed to get record counts for some of my entities and had no idea how to make it quickly. Using the RecordCountShapshot table in ms dynamcis CRM is really good solution.

    ReplyDelete
  3. Subscribe to our Newsletter for up to 50% discount on your first purchase. Own The Look

    ReplyDelete