Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Monitor Database and Log Growth

By Lori Brown,

Most DBA's would like to be notified when automatic database file growth occurs. This script will log file growth. It will not log file shrink but could be easily modifed to do so.

Script does the following:
1. create tables to store server list, current & historical file sizes and actual growth for each database file
2. add a user-defined error message to state that file size has changed
3. create an alert for that message that will notify an operator of file growth
4. create stored procedure to compare the current file size and the stored file size. If file size has changed this stored procedure will raise the error and it will trigger the alert.
5. create a scheduled job to run the procedure regularly.

Total article views: 1955 | Views in the last 30 days: 6
Related Articles

Creating view from stored procedure results

Creating view from stored procedure results


To Create PDF from SQL stored procedure

To Create PDF from SQL stored procedure


create a stored procedure to create a txt file

create a stored procedure to create a txt file


Creating Stored Procedures - SQL School Video

MVP Brian Knight covers the basics of creating stored procedures in SQL Server. Stored Procedures ar...


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones