Skip to content

Instantly share code, notes, and snippets.

@royashbrook
Created February 24, 2018 23:54
Show Gist options
  • Select an option

  • Save royashbrook/0bc2e630a922b31e3fae414077774e69 to your computer and use it in GitHub Desktop.

Select an option

Save royashbrook/0bc2e630a922b31e3fae414077774e69 to your computer and use it in GitHub Desktop.
create table #t (
tablename sysname,row_count int,
reserved varchar(50),data varchar(50),
index_size varchar(50),unused varchar(50))
exec sp_msforeachtable 'insert #t exec sp_spaceused ''?'''
select * from #t
drop table #t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment