数据库大小(报表用)
-- 数据库大小
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
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。