I am New In SQL Server and i have given a task to create a job which calculate the growth rate of SQL Database .
Is there any query through which i can calculate the growth rate of my SQL Database
asked May 29 '12 at 04:43 PM in Default
You'll need a table to store the sizes and record the time you recorded the size. Then schedule a query to record the sizes. How often you run it depends on the level of granularity you want to use for your trend - hourly, daily, weekly etc.
I like to track data file size separately from log size, and the scripts below reflect a very simple version of that. You can get quite sophisticated if you need.
Create the tables (you won't want yours in tempdb, I just put together a sample you can run from end-to-end that cleans up after itself):
Run a query periodically to populate them:
Query the table with excel for pretty trend graphs. Or, just run something in SSMS:
DROP TABLE tempdb.dbo.databaseLogFileSize
Thanks Every one....i have tried to make this query from two table in MSDB Database 1 Backupset and other is backupfile
Provide the Database name
answered May 30 '12 at 10:46 AM
Is there a way to pass the dbnames using a variable instead of typing each one at a time?
answered Nov 15 '12 at 08:24 PM