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]


,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!!