4

how can I see the length of a table (in bytes) on SQL Anywhere? It's possible?

Thank you

Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
Cesar
  • 3,519
  • 2
  • 29
  • 43

1 Answers1

5

To find the number of bytes taken up by the data in a table:

select db_property('pagesize')*(stab.table_page_count+stab.ext_page_count)
    from sys.systab stab join sys.sysuser suser on stab.creator=suser.user_id
    where stab.table_name='table_name' and suser.user_name='user_name'

This does not include the size of any indexes or triggers on the table.

Graeme Perrow
  • 56,086
  • 21
  • 82
  • 121