SQL Server - How to calculate DB growth over a year

Any ideas I how I can calculate the file size / row count growth over a period of a year?
thx
LVL 1
JElsterAsked:
Who is Participating?
 
Guru JiConnect With a Mentor Commented:
Hope that helps,

SELECT
[database_name] AS "Database",
DATEPART(month,[backup_start_date]) AS "Month",
AVG([backup_size]/1024/1024) AS "Backup Size MB",
AVG([compressed_backup_size]/1024/1024) AS "Compressed Backup Size MB",
AVG([backup_size]/[compressed_backup_size]) AS "Compression Ratio"
FROM msdb.dbo.backupset
WHERE [database_name] = N'YOURDATABASENAME'
AND [type] = 'D'
GROUP BY [database_name],DATEPART(mm,[backup_start_date]);

Open in new window

0
All Courses

From novice to tech pro — start learning today.