• You may need to edit your stored procedure. I set that up and it sent me an email for the one database that had more than 80% free. This should be showing me databases that are more than 80% used, or have less than 20% free.

    Quick fix: Set the threshold to 20, then change your delete from #space_used statement to delete anything where the free space is greater than the threshold (ie has more than 20 percent free space available). That should only leave files with less than 20% free.

    --remove any entries that do not fall under the threshold

    DELETE FROM #space_used WHERE free_space_percent > @threshold;

    Otherwise an awesome write-up and most insightful. This saved me a huge bundle of time.

    *bookmarked*