Calculate database size ‘Growth Rates’ on daily basis in SQL Server

Spread the love

Introduction

To calculate database size ‘Growth Rates‘ on a daily basis in SQL Server we need to track database size changes every day. The best solution is to check the database size daily and compare with previous data. We may setup a job in SQL Server and gather the information daily.

Create a database

Use below TSQL script or SSMS and create a database ‘REPORT_DB’ to store daily tracked database growth data.

Database size

Now run the below script to collect current database size & store in table ‘DBSizeDailyReport’ within ‘REPORT_DB’ database.

Check the table

We can check the table within the REPORT_DB database.

If we run select * from DBSizeDailyReport in the REPORT_DB database below result will be shown.

Job & schedule

Now to run the main script daily we may create a job & schedule the job.

So, after a week or month if we check the table we will get the individual day database size. Simply we can compare the date and calculate the database growth rate easily.

# If you want to find database growth size in SQL server instantly here is another post.


Spread the love
Author: OTi
Meet OTi, the brains behind the popular tech blog "OurTechIdeas.com." OTi is an accomplished author, tech enthusiast, and an expert in SQL Server. With over a decade of experience in the tech industry, he has become a trusted voice in the world of database management. OTi's passion for technology began at a young age, and he has been tinkering with computers ever since. He graduated with a degree in Computer Science and has since worked for some of the biggest tech companies in the world. His experience has given him a deep understanding of how technology works and how it can be used to improve our lives.

1 thought on “Calculate database size ‘Growth Rates’ on daily basis in SQL Server

Leave a Reply

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