Monday, February 15, 2010

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 comments:

  1. could u please explain me why we r dividing by 128 and what is the purpose of 128,10,2

    ReplyDelete