//sql query
select TABLE_NAME, SUM(
case
when DATA_TYPE='float' then 8
when DATA_TYPE='int' then 8
when DATA_TYPE='datetime' then 8
when DATA_TYPE='real' then 4
when DATA_TYPE='decimal' then 8
when DATA_TYPE='bigint' then 8
when DATA_TYPE='smallint' then 8
when DATA_TYPE='tinyint' then 8
when DATA_TYPE='char' then
CHARACTER_MAXIMUM_LENGTH*1
when DATA_TYPE='bit' then 1
when DATA_TYPE='nchar' then
CHARACTER_MAXIMUM_LENGTH*2
when DATA_TYPE='varchar' then
CHARACTER_MAXIMUM_LENGTH*2
else
CHARACTER_MAXIMUM_LENGTH*2 end )as ttt from INFORMATION_SCHEMA.COLUMNS
where
TABLE_NAME in (select
TABLE_NAME from
INFORMATION_SCHEMA.TABLES where
TABLE_TYPE='BASE TABLE')
group by TABLE_NAME
No comments:
Post a Comment