Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Size of temp tables in tempdb

Author  Topic 

Bex
Aged Yak Warrior

580 Posts

Posted - 2009-11-03 : 07:23:42
How can I view the size of each temp db created in tempdb?

Thanks

Hearty head pats

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-11-03 : 08:14:13
This will work for one table:
sp_spaceused #test

And this should work for all tables in tempdb:
use tempdb;
exec sp_msforeachtable "sp_spaceused '?'";

As sp_msforeachtable is undocumented, it's best to limit it's usage to adhoc queries only.
Go to Top of Page

Bex
Aged Yak Warrior

580 Posts

Posted - 2009-11-03 : 09:33:24
Thank you Yellow bug

Hearty head pats
Go to Top of Page
   

- Advertisement -