Run the sql statement to retrieve database physical file size, growth, etc.
2010-01-21
3,808 reads
Mahidhar Vattem,
2009-01-14 (first published: 2009-01-03)
Run the sql statement to retrieve database physical file size, growth, etc.
--Finding growth of database files SELECT rtrim(sd.name) as DBName, rtrim(saf.name) AS FileName, rtrim(saf.filename) FilePath, saf.size*1.0/128 AS FileSizeinMB, CASE saf.maxsize WHEN 0 THEN 'Autogrowth is off.' WHEN -1 THEN 'Autogrowth is on.' ELSE 'Log file will grow to a maximum size of 2 TB.' END AutogrowthStatus, saf.growth AS 'GrowthValue', 'GrowthIncrement' = CASE WHEN saf.growth = 0 THEN 'Size is fixed and will not grow.' WHEN saf.growth > 0 THEN 'Growth value is in 8-KB pages.' ELSE 'Growth value is a percentage.' END FROM master..sysaltfiles saf, master..sysdatabases sd WHERE saf.dbid = sd.dbid -- and saf.dbid = 2 GO
2010-01-21
3,808 reads
In this tip we take a look at a few ways to find the current free space within a database, so you can better manage your database files.
2009-08-06
4,986 reads
2009-02-16 (first published: 2009-02-03)
2,609 reads
Scripts will display size of the data in the database/data files and remaining allocated space.
2013-05-10 (first published: 2008-11-17)
3,712 reads
Check out this stored procedure sp_rows to get a listing of space used and rows counts for your SQL Server database tables.
2018-10-10
3,405 reads