Home Forums SQL Server 2008 SQL Server 2008 - General Waring alters when the database (files MDF, NDF & LDF) reaching the MAX size. RE: Waring alters when the database (files MDF, NDF & LDF) reaching the MAX size.

  • Use something like this script to monitor the size and free space of the files.

    Setup a job that runs everyday/week insert into a database to monitor/track over time, send you an email or both.

    SELECT

    [name]

    , [physical_name]

    , CAST(( / 128.0) AS decimal(18,2)) AS FileSizeInMB

    , CAST((fileproperty([name],'SpaceUsed')) / 128.0 AS decimal(18,2)) AS SpaceUsedInMB

    , CAST((( - fileproperty([name],'SpaceUsed')) / 128.0) AS decimal(18,2)) AS FreeSpaceInMB

    FROM sys.database_files

    ______________________________
    AJ Mendo | @SQLAJ