Skip to main content

Posts

Showing posts from July, 2019

Table row Size

select tb.TABLE_SCHEMA as TableSchema, tb.TABLE_NAME as TableName, sum( Case When DATA_TYPE = 'int' then 4 else 0 end + Case When DATA_TYPE = 'nvarchar' and CHARACTER_MAXIMUM_LENGTH > 0 then CHARACTER_MAXIMUM_LENGTH * 2 When DATA_TYPE = 'nvarchar' and CHARACTER_MAXIMUM_LENGTH 18 then 16 else 0 end + Case When DATA_TYPE = 'Numeric' and Numeric_Precision