All Forums Analytics
stuffie0912 4 posts Joined 06/10
16 Jun 2010
using dbc.tablesize, determine total tablesize for a specific user

Using TD SQL Assistant, how can I find the total size of all my tables I have created?

Just for my username.

What statistics are in dbc.tablesize?

will it collect tablesize info for tables I have created if I dd not use "Collect statistics"?

Thank you,


Jim Chapman 449 posts Joined 09/04
16 Jun 2010

The information in DBC.TableSize is maintained for all tables and is not affected in any way by the use of "collect statistics".

This query will show the disk space used by each table you have created.

select databasename, tablename, sum(currentperm) from dbc.tablesize a
where exists
(select 1 from dbc.tables b
where a.databasename = b.databasename
and a.tablename = b.tablename
and b.creatorname = user)
group by 1, 2;

Omit the group by clause if you want only the grand total.

ardhie 13 posts Joined 06/10
22 Jun 2010

nice jim .. :D

i'm excited

You must sign in to leave a comment.