Find Size of files used in Database

  • Comments posted to this topic are about the item Find Size of files used in Database

  • This is a basic helpful script. I just added comma formatting to make it easier to read. Thank you.

    SELECT

    Name

    , Filename

    , convert(varchar, cast(convert(decimal(12,2),round(size/128.000,2)) as money), 1) as FileSizeMB

    , convert(varchar, cast(convert(decimal(12,2),round(fileproperty(name,'SpaceUsed')/128.000,2)) as money), 1) as SpaceUsedMB

    , convert(varchar, cast(convert(decimal(12,2),round((size-fileproperty(name,'SpaceUsed'))/128.000,2)) as money), 1) as FreeSpaceMB

    FROM

    dbo.sysfiles

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply