Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all articles
Browse latest Browse all 52382

How many tables and records are in your Dynamics CRM Database?

$
0
0

Today's post is written by Keith Mescha, Principal Architect at Sonoma Partners.

There are many reasons to want to know how many records are in each table in your MSCRM database. One of the primary instances in which we use this information is when we are assessing the level of effort required to upgrade a client from older versions of CRM, or from MSCRM On-Premise to MSCRM Online.

When migrating customers from one version of MSCRM to another, it's good to get a handle on what's in the current system from both an entity and record count standpoint. This is also a good way to know which entities are being used, and which are not. It's also very easy to pick out non-native objects as they will have a prefix on them. Sometimes you will see more than one prefix, which will indicate that 3rd party solutions are installed or they have had many different groups or people in their customizing without maintaining consistency.

There are a few tools out there that do this type of thing, but if you are On-Premise and have access to the underlying SQL database, and have a little bit of experience working in SQL, this can be quite simple.

BTW if you have an Online Microsoft Dynamics CRM org and want to get some record counts, see this blog to learn about Dynabacus, an application we built to help count records within Microsoft Dynamics CRM Online.

Once you get into that database via SQL Server Management Studio (SSMS) you can get row counts for all tables in a couple of different ways. One easy way is to run this simple SQL query and copy and paste the data from the results pane to Excel, and then start analyzing from there.

/* Change <orgname_dbname> to be the name of your organization database* */

USE<orgname_dbname>

GO

 

SELECT t.name, s.row_count, s.index_id

fromsys.tables t

JOINsys.dm_db_partition_stats s

ON t.object_id= s.object_id

AND t.type_desc ='USER_TABLE'

AND s.index_id <2

orderby 1

 

Depending on what version of SQL Server you are running there are also some built-in reports into SSMS you can use if you right click on the database name in SSMS and select the reports option. Run the Disk Usage by Table report. This will query the database and return you a simple interactive report where you can do some basic sorting. This will help you quickly uncover which tables have the most records, or which tables are taking up the most disk space.

Photo 1


Finally, within SSMS there is the ability to use the Object Explorer Details option from the View menu. You can then drill into the tables object. This will bring up a list of all your tables and some SQL technical stuff you don't care much about. If you right click on the header row you can select and deselect what columns to show. To make it cleaner, I typically remove all the other columns and only add the Row Count column. This is my go-to method when trying to get a quick glance at how many rows are in the tables in a MSCRM Org. The nice part about this one is your column selection is saved, so next time you go in you just browse to the tables and you get a quick read of the row counts.

 

Photo 3


Photo 4

 

Want to discuss the tables and records in your Dynamics CRM Database? Contact us to learn. In the meantime, download Dynabacus, the Microsoft Dynamics CRM Record Count Tool.

Dynabacus the Microsoft Dynamics CRM Record Count Tool

 


Viewing all articles
Browse latest Browse all 52382

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>