Easy Way to Check Space Usage in Your Microsoft SQL Database

This step show you the space usage by your SQL database and by its log file. This will show space size in MB.

Steps:-

1. Open Microsoft SQL Server Manager Studio to connect with SQL Database

2. Click on your database to select your database

3. Create new query

4.  Now use below T-SQL Script into this newly opened Query windows

5. Execute this query by clicking Execute Button or press F5 Key to execute it.

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

There is no variable used in this query so no need to change anything.

Looking for quality web hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , | Posted under Internet | RSS 2.0

Leave a Reply

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


− 3 = 3

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>