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.

Anvesh Patel

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