Thanks for the input Tom .....
But I'm not sure if it will work.. You see I already have this code and
other code wrapped in a
I beleive SQL 7.0 gets confused when running a foreach of DB and a
foreach for table..
Any other suggestions?
> If you're using 7.0 then you can use the stored procedure
> sp_MSForEachTable to do what you're trying to do. Try something like:
> sp_MSForEachTable 'INSERT INTO #TmpTblSpaceUsed EXEC sp_spaceused "?"'
> or you can also try:
> INSERT INTO #TmpTblSpaceUsed sp_MSForEachTable 'EXEC sp_spaceused "?"'
> > If someone can write an easier way, please let me know!!!.
> > What I would like to do is read particular table names from
> > and using sp_spaceused, populate the table TmpTblSpaceUsed.
> > I'd rather not have to open a cursor and was wondering if I could do
> > this using only a couple of lines.
> > PS. Is there also an easy way to convert the varchar(18) eg '18 KB'
> > results from sp_spaceused to a numeric value ... eg 18
> > CREATE TABLE #TmpTblSpaceUsed
> > (table_name sysname,
> > nrows int default 0,
> > reserved varchar(18),
> > data varchar(18),
> > index_size varchar(18),
> > unused varchar(18)
> > )
> > sysobjects.id > 50099219 '
> > Thanks
> > TwoPlusTwo
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Sent via Deja.com http://www.deja.com/
Before you buy.