»
S
I
D
E
B
A
R
«
Get the row count from each table in a database
Nov 17th, 2008 by Josh Rivers

Just an SQL Snippet for today:

create table #rowcount (tablename varchar(128), rowcnt int) exec sp_MSforeachtable 'insert into #rowcount select ''?'', count(*) from ?' select * from #rowcount order by rowcnt desc drop table #rowcount

»  Substance: WordPress   »  Style: Ahren Ahimsa