How to list all the user tables in Sybase along with their row count?
It depends on what Sybase product you mean. In my SQL Anywhere (9 and 11), your solution doesn't work, but this works:
select table_name, count
from systable
where primary_root<>0 and creator=1
order by 1
Here is the Sybase sql that does the above:
select ob.name,st.rowcnt
from sysobjects ob, systabstats st
where ob.type="U"
and st.id=ob.id
order by ob.name