I have written a script that selects tables based on certain conditions from an SQL server. I also want to calculate the size of the tables that I have selected.
Currently I have something of the nature:
select distinct table_name from abc a inner join b on a.id = b.id
From here I would like to be able to list the sizes like so:
table | size
---------------
x | 4 mb
---------------
y | 2.2 mb
---------------
z | 3 mb
The resources I found online do not work on SQL server they are MySQL specifc, any help/guidance is appreciated.