标签:des 数据 ar size 数据库 table file har
-- 数据库大小
CREATE TABLE #tmptb(NAME VARCHAR(100),db_size VARCHAR(100),
OWNER VARCHAR(500),dbid INT,created DATE,STATUS VARCHAR (500),
COMPATIBILITY_LEVEL INT,FILENAME VARCHAR(500))
INSERT INTO #tmptb(name,db_size,OWNER,dbid,created,STATUS,COMPATIBILITY_LEVEL)
EXEC sp_helpdb
UPDATE #tmptb SET FILENAME = b.FILENAME
FROM #tmptb a INNER JOIN master.dbo.sysdatabases b ON a.dbid = b.dbid
SELECT name,db_size FROM #tmptb where dbid >= 5 order by db_size desc
DROP TABLE #tmptb
标签:des 数据 ar size 数据库 table file har
原文地址:http://www.cnblogs.com/gezifeiyang/p/3897954.html