How to find size of table in MSSQL?

Everyone would have come across a scenario where there is a need to find the Size of the table in MSSQL. There are multiple ways to find size of table in MSSQL.

How to find Size of table in MSSQL using the stored procedure?

Once the script is executed the output structure will be shown as below screen shot.

SQL Table Size Script

Column Details Explanation goes below.

Name: Provides the name of the table
Rows: Provides the total no of records in the table
Reserved: Provides the total space allocated to objects in the database.
Data: Provides the total space used by the data.
Index: Total amount of space used by the indexes.
Unused: Total amount of space reserved for objects in Database but not used yet.

The other way to find out the table size is through SQL Management Studio Interface.

Step 1. Connect to your database from SQL management studio
Step 2. Right click on the table which you need to find the size and click on properties.
Step 3. In the table property window select storage option as shown in the screenshot to find the table size and details

SQL Table Size Object Explorer

The final option is to write your own script and get the size. Find the below SQL snippet which returns all the tables size in your current database.

To find the size of all the tables in the current database use the below script. Not the where the condition is modified to get all the tables here.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *