HanShi (11/25/2016)
Use the queries below to get the desired information.Execute it at regular intervals (daily?) and store the results. Build a reporting query on these stored results to get the differences in size over time.
SELECT Db_name(database_id) AS database_name
, NAME AS file_name
, type_desc
, Cast(size * 8.0 / 1024 AS DECIMAL(10, 2)) AS size_MB
, Cast(max_size * 8.0 / 1024 AS DECIMAL(10, 2)) AS max_size_MB
, GetDate() as inquiry_date
FROM sys.master_files;
SELECT database_name
, backup_size
, compressed_backup_size
, GetDate() as inquiry_date
FROM msdb..backupset;
Just a bit of a simplification...
SELECT Db_name(database_id) AS database_name
, NAME AS file_name
, type_desc
, Cast(size / 128.0 AS DECIMAL(10, 2)) AS size_MB
, Cast(max_size / 128.0 AS DECIMAL(10, 2)) AS max_size_MB
, GetDate() as inquiry_date
FROM sys.master_files;
--Jeff Moden
Change is inevitable... Change for the better is not.