--H! friends this is Atul B Pathrikar
Learn how to check the size of SQL Server tables in MB using T-SQL queries. This beginner-friendly tutorial shows how to find table size, index size, and total storage used by your database tables.
--today we learn about check table size by query & partition allocation
SELECT DISTINCT OBJECT_NAME(p.object_id) TableName,
total_pages/128. SpaceUsed_MB,
p.rows,p.partition_id,p.index_id,p.partition_number,p.data_compression_desc
FROM sys.partitions P JOIN sys.allocation_units AU ON P.partition_id = AU.container_id
join sys.objects o on o.object_id=p.object_id
where o.type='U' -- for user define table only
order by SpaceUsed_MB DESC
-- sys. -- inbuilt dynamic management view by sql server
-- able to below dataset table result showing memory occupie in MB
-- Thank you for watching this video