Do you need to know the size of a database in Microsoft SQL 2008 R2 Server (or SQL Server 2005 or SQL Server 2008)? Fortunately there is a predefined stored procedure that may be run to show the size of any database in SQL server. This makes finding the size of a database quick and easy!
Here then are instructions to get the size of your SQL database:
- Access SQL Server via Microsoft SQL Server Management Studio.
- In the Object Explorer highlight expand ‘Databases’ then click once on the database of which you require the size.
Click the New Query button on the toolbar near the top of the screen.
Enter the following in the new quest window pane that appears:
- Click the Execute button in the toolbar
You’ll notice the following in the results tab:
database_name: The name of the database
database_size: Size of the data and log files in the database
unallocated space: Non-reserved database space
reserved: Space allocated by objects in the database.
data: How much space is used by data
index_size: How much space is used by indexes
unused: Reserved space that is unused