Hi @Pasquale Massimo Scorca ,
Please refer below:
- If you only need to look at the overall usage of data files, DBCC SHOWFILESTATS is a better choice.
- If you want to see the space usage of each object, you can use the dynamic management view sys.dm_db_partition_stats.
- If you still want to know the usage and fragmentation of each page, each area, then DBCC SHOWCONTIG or DMV sys.dm_db_index_physical_stats is a better choice.
In your situation, you could consider to use DBCC SHOWFILESTATS to get the size of one database and use sys.dm_db_partition_stats or DBCC SHOWCONTIG(sys.dm_db_index_physical_stats) to get the size of one table.
USE AdventureWorks2016
DBCC SHOWFILESTATS
SELECT * FROM sys.dm_db_partition_stats
WHERE object_id = OBJECT_ID('HumanResources.Employee');
DBCC SHOWCONTIG ('HumanResources.Employee');
Sp_spaceused 'HumanResources.Employee'
You could also refer below link for more details about calculation:
SQL Server Table Size Estimator
If the response is helpful, please click "Accept Answer" and upvote it.
Best regards
Melissa