Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining Table sizes (in KB)

SQL Server Administration

Determining Table sizes (in KB)

by  BigTeeJay  Posted    (Edited  )
Ever wanted to find out the amount of space a table
is taking up (in Kilobytes, not record size... although
you will be able to get the record size too this way).

Microsoft has a very convoluted method of doing this
(a 10 step process that can be found in the latest
"SQL Books online", go to the index and look under the
heading "tables-SQL Server" and then "calculating size",
then choose "Estimating the Size of a Table"). Which
I guess, if you dont have access to Enterprise Manager
you would have to do this.

But, if you do have Enterprise Manager, just select
your Database in the left-hand pane. Then goto the
View menu (in the Console Root, not in the MMC main
window, where you sometimes get a View menu)...

Choose "Taskpad", then go to the "Table Info" tab in
the right-hand pane, and you will be presented with
the number of records, as well as Total table size and
the size for each index associated with a table, all in
Kilobytes.

Hope this helps someone (sure beats the method I was
going to have to try to get the same info).

Tj

12/7/04: User, Kaz999 pointed out an easy way to get this kind of information via TSQL...

Code:
exec sp_spaceused <tablename>

...gives you...

Code:
name    rows      reserved     data         index_size  unused
<name>  17991232  12636448 KB  11051664 KB  1583816 KB  968 KB
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top