SQL Server查看所有表大小,所占空间

http://www.cnblogs.com/nikyxxx/archive/2012/10/08/2715423.html

select * from sys.databases
 ALTER DATABASE pubs SET RECOVERY SIMPLE
 
空间不够!!!
事务日志已满 请参阅sys.databases中的log_reuse_wait_desc列解决办法
sp_helpdb EmpService
DBCC SQLPERF(LOGSPACE)
dbcc loginfo

backup log EmpService with no_log
dbcc shrinkdatabase(EmpService)

以上需要對sys有權限,只有該database權限的話,試試這個
exec sp_spaceused
exec sp_spaceused testtable
select name from sysobjects where xtype='u' order by name

SELECT   a.name, b.rows
FROM      sysobjects AS a INNER JOIN
                 sysindexes AS b ON a.id = b.id
WHERE   (a.type = 'u') AND (b.indid IN (0, 1))
ORDER BY b.rows DESC

原文地址:https://www.cnblogs.com/sui84/p/6777075.html