end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

sybase dbにある各テーブルの行数やファイルサイズの表示

mysqlのinformation_schema.tablesによるテーブルサイズの表示 - 改 - end0tknr's kipple - web写経開発

以前の上記entryにある通り、mysqlでは information_schema.tables に対しての select sqlで取得できますが、 sybase db の場合

select
     convert(varchar(30),o.name)  AS table_name
    ,row_count(db_id(), o.id)     AS row_count
    ,data_pages(db_id(), o.id, 0) * (@@maxpagesize/1024) AS size_kb
from sysobjects o
where type = 'U'
order by table_name

go

または isqlで接続し、以下

sp_spaceused <table>

go