SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Monitor Database size
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sqlpal2007
Posting Yak Master

182 Posts

Posted - 08/16/2012 :  09:55:49  Show Profile  Reply with Quote
Hello,

I wrote a CTE to get the database file size and available space using sys.database_files table.

Can anyone tell me how to write a query to calculate % increase weekly for each database?

Thanks,

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3328 Posts

Posted - 08/16/2012 :  10:04:35  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
Log it to a table then just compare the last reading with that for the previous week.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

sqlpal2007
Posting Yak Master

182 Posts

Posted - 08/16/2012 :  14:01:22  Show Profile  Reply with Quote
I will have to exclude the first row though as there won't be any previuos record to compare against.

Do you have a sample of it?
Go to Top of Page

tfountain
Constraint Violating Yak Guru

USA
491 Posts

Posted - 08/20/2012 :  14:03:19  Show Profile  Reply with Quote
If you do backups on a regular schedule, just query the tables in msdb to calculate the deltas. This will provide you information on their growth rate. This way you're not reinventing the wheel (logging to a table) and you just measure the difference between your full backups. If you have differentials in mix that provides the rate of change to the granularity of whatever schedule your diffs are on.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000