17 September,2012 by Tom Collins
A quick way to to find the Database File Size and Log File Size, by querying the sys.master_files.size column.
The sys.master_files.size column returns the file size in 8 KB pages. Therefore some division is required to calculate in MB and GB.
If the sys.master_files = ROWS it’s a data file . If the sys.master_files = LOGS it’s a log file .
select db_name(database_id) as dbname, type_desc,(size * 8) /1024 as size_MB, (size * 8) /1024/1024 as size_GB from sys.master_files order by name
Attach database without log file and rename database
SQL Server – files and filegroups. Improving database performance
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |