apr 18 blog

T-SQL Get a quick overview of the sizing in SQL Database Version 2

From my yesterday post I found a more detailed version at getting the overview:

create table #Temp (
name nvarchar(128),
[rows] char(11),
reserved varchar(18),
data varchar(18),
index_size varchar(18),
unused varchar(18)
)

insert into #Temp
exec sp_msforeachtable 'sp_spaceused ''?'''

select * from #Temp order by cast(replace(reserved,' kb','') as int) desc

drop table #Temp

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Google+