[dba-SQLServer] NEVERMIND (Fw: executing system stored procedure)

Susan Harkins ssharkins at gmail.com
Tue Jan 13 14:38:20 CST 2009


I've tried several examples now -- they run, but they don't actually return 
anything -- this one creates the table, but doesn't fill it.

Susan H.


> Try this
>
> Just lifted it of the web
>
> use pubs
> go
> create table #rowcount (tablename varchar(128), rowcnt int)
> exec sp_MSforeachtable
>   'insert into #rowcount select ''?'', count(*) from ?'
> select top 5 * from #rowcount
>    order by tablename
> drop table #rowcount




More information about the dba-SQLServer mailing list