概述create table #lyf_Data(name varchar(100),row varchar(100),reserved varchar(100),data varchar(100),index_size varchar(100),unused varchar(100)) create table #lyf_Data(name varchar(100),row varchar(100),reserved varchar(100),data varchar(100),index_size varchar(100),unused varchar(100)) declare @name varchar(100) declare cur cursor for select name from sysobjects where xtype='u' order by name open cur fetch next from cur into @name while @@fetch_status=0 begin insert into #lyf_data exec sp_spaceused @name print @name fetch next from cur into @name end close cur deallocate cur create table #lyf_D@R_404_6081@ew(name varchar(100),row int,reserved int,data int,index_size int,unused int) insert into #lyf_d@R_404_6081@ew select name,convert(int,row) as row,replace(reserved,'KB','')) as reserved,replace(data,'')) as data, convert(int,replace(index_size,'')) as index_size,replace(unused,'')) as unused from #lyf_data select name,row,data/1024 as data_size,index_size/1024 as index_size from #lyf_d@R_404_6081@ew order by data desc drop table #lyf_data drop table #lyf_d@R_404_6081@ew 总结
以上是内存溢出为你收集整理的sqlserver中按照表的大小进行排序全部内容,希望文章能够帮你解决sqlserver中按照表的大小进行排序所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
评论列表(0条)