SQL Anywhere 11 - table size
sql, sqlanywhere
Solution
Possibly the system view SYSTAB can be a good-enough alternative. It can give you the number of rows in the table, and it can give you how many pages the table uses. (In the sample below, I'm multiplying the number of pages by the DB's page size to get a total byte size.)
SELECT
count, -- number of rows in the table
(table_page_count * DB_PROPERTY('PageSize')) tablesize
-- total size, in bytes
FROM SYSTAB
WHERE table_name = 'mytable'; -- or whatever limitations you want on
-- the scope of the query
Hope this helps.
Problem
I am trying to get the table size for each table from a database using SQL Anywhere 11. I just found out `sp_spaceused` has been deprecated Any help with this would be greatly appreciated! :)