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

Susan Harkins ssharkins at gmail.com
Tue Jan 13 14:40:37 CST 2009


Okay -- now that's just plain weird -- went back to the traditional sys.sp 
syntax, and it works -- that's just odd.

I'm sure some typo's to blame, but that's frustrating as I tried the 
simplest of things and couldn't get anything.

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
>
>
>
>
>
> Martin
>
>
> Martin WP Reid
> Information Services
> Queen's University
> Riddel Hall
> 185 Stranmillis Road
> Belfast
> BT9 5EE
> Tel : 02890974465
> Email : mwp.reid at qub.ac.uk
> ________________________________________
> From: dba-sqlserver-bounces at databaseadvisors.com 
> [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins 
> [ssharkins at gmail.com]
> Sent: 13 January 2009 20:20
> To: SQLList
> Subject: [dba-SQLServer] NEVERMIND (Fw: executing system stored procedure)
>
> Was looking for
>
> EXEC master..sp_MSForEachTable
>
> Now, if I could just get it to work -- system finds the sp, but it doesn't
> work as expected.
>
> Susan H.
>
>
>> USE database
>> EXEC sys.sp_MSForEachTable command
>>
>> says it can't find the stored procedure -- I remember I had this problem
>> once before, but I don't remember why. Any help? When I run it against
>> master, I get a command successfully completed, not a "can't find"
>> message, so it must be there.
>>
>> Susan H.
>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
> 




More information about the dba-SQLServer mailing list