How to check DBs Used space and row counts

SQL Report to check the DBs used space and row counts

For smooth migration it’s always recommended to go through the environment validation and part of prerequisite is to check the SharePoint Content DB size and row counts which may interrupt the migration also check out SharePoint boundaries and limits.

https://docs.microsoft.com/en-us/sharepoint/install/software-boundaries-and-limits-0

SQL Command:
(To avoid any support from MS, I strongly recommend you to run below command in the non-production environment)

DECLARE c CURSOR READ_ONLY FAST_FORWARD FOR
SELECT [TABLE_NAME]
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = ‘BASE TABLE’
DECLARE @tableName varchar(100)
OPEN c
FETCH NEXT FROM c INTO @tableName
WHILE (@@FETCH_STATUS = 0)
BEGIN
exec sp_spaceused @tableName
FETCH NEXT FROM c into @tableName
END
CLOSE c
DEALLOCATE c

Reference: http://blogs.msdn.com/b/sowmyancs/archive/2012/06/29/alldocversions-amp-alldocstreams-table-size-after-upgrading-to-sharepoint-2010.aspx