How to check MS SQL Database Space usages?


1. Connect you SQL Database using SQL Server Management Studio

2. Select your database

3. Open New Query

4.  use the following T-SQL Script into newly opened Query windows

5. Click Execute Button or hit F5 Key

T-SQL Script:-
SELECT DB_NAME() AS DatabaseName
, name AS FileName
, size/128.0 AS CurrentSizeOnDisk_MB
, CAST(FILEPROPERTY(name, ‘SpaceUsed’) AS INT)/128.0 AS SpaceUsed_MB
FROM sys.database_files