SQL Query: Whats the size of your Database tables?
Well this week was a hoot, its always fun the week before you take a week off.
Anyway I got a chance to spend a few hours with a Microsoft SQL Guru, trying to brush up on my TSQL. One of the many things I learned is that I use the GUI too much, and it only slows me down. Besides that one other thing that he showed me was some of the diverse information that is in sysindexed and other system tables, not something I look into on a daily basis. At any rate he had showed me how to convert numbers to strings and use them to do calculations and soon had this nice example of several things he had showed me. In my opinion there was too much out put I was only really interested in getting table names and their sizes in MB, I really don't use the plethora of information that was generated by his script. So this weekend I tamed it down to only display the results that I wanted, Table Name and Size of the tables in MB. I'm not putting my name on this one b/c the SQL Guy did all the real work I just trimmed down the output and told it to use the Onepoint database, but this could be used on any Database.
Note that the table sizes are approximates not the exact size but a good approimate is always helpful. 
-- 12/16/2007
-- Any DB will show the table size in MegaBytes
-- worked with a SQL Guru at M$ for a few hours last week, here are some fruits of mostly his labor
Use OnePoint
Go
select object_name(id) [Table Name],
[Table Size] = convert (varchar, dpages * 8 / 1024) + 'MB'
from sysindexes where indid in (0,1)
order by dpages desc
-- Have A great Week!