Hi All,

Query to find the size of the database and database file is a simple and most common requirement. There are many ways & techniques to do this. Here are ‘just’ some of them:

Technique 1:

Gives you the database size and certain more properties of it:


Technique 2: For a specific database:

And you get the following output: (this one gives you the database and data file information for a specific database)


Technique 3: be in the context of the database and run sp_spaceused

This is what you get:


Technique 4: use sys.master_files



If there are more ways, do post a comment, would like to learn more. Thanks !



Rahul Sharma

Like us on FaceBook Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook