How to get Table and Database size using T-Sql

Posted By  RRaveen On 15 Dec 2010 10:12:33
emailbookmarkadd commentsprint
No of Views:830
Bookmarked:0 times
Votes:0 times

Introduction

Today I would like to check my database and other few table size in online database. For that I have been use the system stored procedure to get the tables and database size. Here would like share with you.

How to Get Database Size?

Just copy below script and run in your server management studio or query analyser.

EXEC sp_spaceused

The sp_spaceused is a system procedure. this is work without argument or with argument as well. For example if you need to take database size, you don’t need to pass the any arguments.

Output

Image Loading

How to Get Table Size?

EXEC sp_spaceused 'userpointsdetail'

In above script, i try to view the size of the UserPointDetails table size.

Output

Image Loading

You able to see how many KB have been allocated and how many Kb has been used. even you can see how many rows has in this table.

References

http://msdn.microsoft.com/en-us/library/ms188776.aspx

Hopes help.thank for reading.

Sign Up to vote for this article
Other popular Tips/Tricks
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top