Home
Manage Your Code
Snippet: Get table size in Teradata database (SQL)
Title: Get table size in Teradata database Language: SQL
Description: Get table size of all tables in a Teradata database Views: 1135
Author: Do Bach Vi Date Added: 7/20/2011
Copy Code  
Select tablename, sum(currentperm) as TableSize from dbc.tablesize
where databasename = 'U_GSI_ANALYTIC_P'
group by tablename
Usage
Just run the query. Result is an answer set includes Tablename and Tablesize (in byte).
If you want Tablesize in MB, divide table size by 1024/1024 as below:
Select tablename, sum(currentperm)/1024/1024 as TableSize from dbc.tablesize
where databasename = 'U_GSI_ANALYTIC_P'
group by tablename