sp for table size within database

I need a stored procedure to give me my table size within a database.
robjayAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
david_levineConnect With a Mentor Commented:
What about:

EXEC sp_spaceused 'your_table_name'

or are you looking for something else?

David

0
 
robjayAuthor Commented:
OK.  I was actually looking for a sp that would go thru all tables in a database and give out the spaceused info.

Thanks.
0
 
david_levineCommented:
What you can do then is first execute:

select "exec sp_spaceused '"+name"+"'"
from sysobjects
where type ="U"
order by 1

and that will produce as rseults, the input to a second step which will run and produce the sp_spaceused for all tables.

David
0
All Courses

From novice to tech pro — start learning today.