SQL Server: Script to find the size of Database Files and Log Files

In this post, I am providing an SQL Script to find the size of Database Files and Log Files in SQL Server.

I am calculating this size using sys.master_files and perform require division to get size in MB and GB because it is returning 8 KB pages.

The Database Administrator can use this script to get quick size of Database Files and Log Files of a SQL Server. SQL Server Management Studio also provides GUI tools, but still I always use different script to do my DBA task.


Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

2 Comments on "SQL Server: Script to find the size of Database Files and Log Files"

Notify of
avatar
Sort by:   newest | oldest | most voted
sdorttuiiplmnr
Guest

I truly treasure your work, Great post.

trackback

thank you, help a lot….

wpDiscuz