最近客户的数据库暴涨,一开始找不到原因,用sql查询表的空间大小,结果之前用的sql语句只能查询除了text,image外的字段大小.搞得一时间混乱不堪.后来咨询了大师们,找到用sp_spaceused这个系统函数可以查询表的真实大小,包含text等字段.sql如下:declare @id NVARCHAR(100)create table #spt_space( [name] NVARCHAR(50) null, [rows] int null, [reserved] NVARCHAR(50) null, [data] NVARCHAR(50) null, [index_size] NVA. Read More
posted @ 2011-07-01 10:49 温景良(Jason) Views(3105) Comments(0) Diggs(0) Edit