I'm a beginner in SQL and I executed the below Stored Procedure in MSSQL to get the disc space related stuff for a table. This one is giving the current status of this table. If I run the same tomorrow, It gives me the similar stuff and We can insert this into a table for the regular monitoring.
EXEC sp_spaceused '[dbo].[TableName]'
But I'm looking for the same data from last one year to see how this table is growing by each month, May be I want to extend it to all tables in my DB.
I tried running this Stored Procedure regularly, it is going to help for future statistics, but not for historical.
CodePudding user response:
You could simply insert into and maintain a table of these stats on an ongoing basis. Then compile results over time.
CodePudding user response:
the subject is extensively discussed in the following post DB Admin - Which table is causing the hike
hope this helps NR