About row size or length in mb or kb of a table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bhmadhukar
    New Member
    • Mar 2008
    • 4

    #1

    About row size or length in mb or kb of a table

    i created a table 'test' and with one column named with
    ename varchar(20). it has two rows. now what my question is how i can calculate the row size or length (in kb or mb). can anyone tell me based on this example?
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by bhmadhukar
    i created a table 'test' and with one column named with
    ename varchar(20). it has two rows. now what my question is how i can calculate the row size or length (in kb or mb). can anyone tell me based on this example?
    try using this

    -- CK

    Comment

    • deepuv04
      Recognized Expert New Member
      • Nov 2007
      • 227

      #3
      Originally posted by bhmadhukar
      i created a table 'test' and with one column named with
      ename varchar(20). it has two rows. now what my question is how i can calculate the row size or length (in kb or mb). can anyone tell me based on this example?
      Hi,
      you can also use the following query

      [code=sql]
      select
      sys.objects.[name],
      sys.objects.[object_id],
      count(sys.colum ns.[name]) As ColumnCount,
      sum(sys.columns .max_length) As MaxLength
      from
      sys.objects
      inner join sys.columns on sys.objects.obj ect_id = sys.columns.obj ect_id
      where
      sys.objects.[name] = Table_Name
      group by
      sys.objects.[name],
      sys.objects.[object_id]
      [/code]

      Comment

      Working...