sql server table size in mb query code example Example: check size of table sql SELECT pg_size_pretty( pg_total_relation_size('tablename') ); (postgres)