Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Get size of Individual table in SQL Server 2000

Posted on 2007-08-02
Medium Priority
Last Modified: 2008-01-09
How do I get the size of an individual Table in SQL Server 2000.
Are these accurate:

EXEC sp_spaceused 'TableName'

Exec sp_MStablespace 'TableName'

Question by:LegalZoomer
  • 2
LVL 29

Expert Comment

ID: 19619948
Yes, those are accurate. However, there are some instances where it may be incomplete (for example, you have just dropped a large index, and the sysindexes information is not current)

To force 100% accuracy, run with the optional updateusage parameter

EXEC sp_spaceused 'TableName','TRUE'

Note, however, that this could hamper performance while it is running and can take some time on larger tables (essentially scans the data pages for the table in the database and makes any necessary corrections to the sysindexes table), so only use it if you suspect that there are incorrect values being returned.

Author Comment

ID: 19620389
Ok when I run the query for one of my tables I get the following results:

Name      Rows         Reserved Space      Data            Index Size       Unused
Table      10914680   721032 KB      710104 KB     4360 KB      6568 KB

How do I get the total size used.
Is it Data + Index Size = Total ?
LVL 29

Accepted Solution

Nightman earned 1000 total points
ID: 19620415
You just need to look at the Reserved Space.

Reserved Space = Data +  Index Size  + Unused

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Blockchain technology enhances society similar to the Internet. Its effects are broad, disruptive, and will boost global productivity.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question