Determine row size for table

前端 未结 6 1668
生来不讨喜
生来不讨喜 2020-12-03 02:38

How to I determine the maximum row size for a table? I\'m looking for a tool or script that does this so I don\'t have to add up each column\'s size by hand.

My goal

6条回答
  •  执笔经年
    2020-12-03 03:09

    Here is another query I got, but like Tomalak's it is broken because it doesn't take into account things like the overhead for variable length columns.

    SELECT OBJECT_NAME (id) tablename
         , COUNT (1)        nr_columns
         , SUM (length)     maxrowlength
    FROM   syscolumns
    GROUP BY OBJECT_NAME (id)
    ORDER BY OBJECT_NAME (id)
    

提交回复
热议问题