CREATE TABLE #TableSizes
(
table_name SYSNAME,
row_count int,
reserved_size varchar(10),
data_size varchar(10),
index_size varchar(10),
unused_size varchar(10)
)
INSERT #TableSizes EXEC sp_MSforeachtable 'sp_spaceused ''?'''
SELECT table_name,row_count, replace(reserved_size,' KB','') reserved_size,replace(data_size,' KB','') data_size, replace(index_size,' KB','') index_size, replace(unused_size,' KB','') unused_size FROM #TableSizes ORDER BY table_name
drop table #TableSizes
go

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 weihsinchiu 的頭像
    weihsinchiu

    維新生活日記

    weihsinchiu 發表在 痞客邦 留言(0) 人氣()