Script to find out data and log file size


You can use below script to find out data file (*.mdf) and Log file (.ldf) size

exec sp_helpdb [dbName]

or

use [dbName]
select str(sum(convert(dec(17,2),size)) / 128,10,2) + 'MB'
from dbo.sysfiles

2 thoughts on “Script to find out data and log file size

Leave a reply to new Cancel reply