SELECT OBJECT_NAME(i.object_idAS TableName,data_pages*8 AS DataSize --这里返回的是数据页个数,1页是8K,所以乘以8
FROM sys.indexes as i
JOIN sys.partitions as p ON p.object_id = i.object_id and p.index_id = i.index_id
JOIN sys.allocation_units as a ON a.container_id = p.partition_id
where i.object_id=OBJECT_ID('tablename'
posted on 2009-01-07 12:27  大斌锅  阅读(228)  评论(0编辑  收藏  举报