--查看所有表的大小 declare @id int ) declare @pages int declare @dbname sysname ,) ,) ,) create table #spt_space ( [objid] int null, [rows] int null, ) null, ) null, ) null, ) null ) set nocount on -- Create a cursor to loop through the user tables declare c
在Sqlserver数据库中,一般我们查看数据库的大小可以通过查找到数据库文件来查看,但如果要查找数据表Table的大小的话,则不可通过此方法,在Sqlserver数据库中,提供了相应的SQL语句来查询数据库DataBase的大小,以及库中相应表的大小. 首先选中数据库,可以通过手工选择,也可通过在新建查询窗口通过语句选择.通过语句选择的命令为 Use DataBaseName go 选择对应数据库后,在新建查询窗口执行以下语句即可查询该数据库大小: exec sp_spaceused; 查询数
sql查看所有表大小的方法. 代码: declare @id int ) declare @pages int declare @dbname sysname ,) ,) ,) create table #spt_space ( [objid] int null, [rows] int null, ) null, ) null, ) null, ) null ) set nocount on -- Create a cursor to loop through the user tables d