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 space used for disks, DBs, tables and filegroups

By Steen Molberg,

I pieced this script together from solutions I found on this and from Brian Knight's excellent book. It creates 3 tables: - tblDriveLogs. Collects free drivespace info for each drive for each time the script is run. - tblIndexLogs. Collects info on spaceused for each index and table. Please note that when only af single index exist, TableNm and IndexNm is the same. This is because of the way the info is organized in sysindexes. - tblFileLogs. Keeps track of the sizes and spaceused in the filegroups and logs for each database. My idea with this solution was to have way of tracking space and spaceused over time. I wanted to make a Access reporting tool og maybe a nice webpage with some cool stats of the data but haven't got around that yet. Hope you can use the script. If you find any room for improovement or any stupidities please let me know. If you think it's great please let me also know ;-) Thanks.

Total article views: 876 | Views in the last 30 days: 4
Related Articles




The joy of sp_spaceused

This script uses a cursor to loop through all tables and get the count and table sizes using sp_spac...


spaceused of a table

spaceused query...



hi I want to exe sp_spaceused for every 5 hrs and store the result in table. I created sql job ...


Capturing DB Usage stats – sp_spaceused simulation using DMV’s.

SP_SPACEUSED sp_spaceused is one of the system stored procedure used frequently by many dba’s tha...


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