How do I find out what tables are using the most space in the database

Problem

The database is growing and to determine what actions, if any are needed to reduce the size of the database, you need to know which tables are using the most space 

Solution

SQL skills are required

A sound knowledge of SQL is required to perform this task

There is a stored procedure that is created in each Jiwa database that will list all the tables in a Jiwa database with details of the row count and space allocated.  Results can be copied into Excel and sorted on space used.

  1. Load SQL Server Management Studio and connect to the relevant SQL server

  2. New query and run usp_Jiwa_SpaceUsed





  3. Copy the results including the header row

  4. Open Excel and paste in the results

  5. Sort on the field DataSpace using largest to smallest to see the tables that are using the most space





Additional article

Review Reducing the size of the database for more information on this topic