--//Sql Queries
select DATA_TYPE,
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 [Data_Type_Sizes],
count
(DATA_TYPE)as [ No Of Data_Types]
from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='Table Name'
group by DATA_TYPE
No comments:
Post a Comment