All database files growth

  • Comments posted to this topic are about the item All database files growth

  • If you are not able to view the script.

    Pls click on scriptmanager.

  • Nice script.

    I found on my servers, 2008 R2, I had to divide growth by 128 to reflect the value shown in the UI.

    Bill Soranno
    MCP, MCTS, MCITP DBA
    Database Administrator
    Winona State University
    Maxwell 143

    "Quality, like Success, is a Journey, not a Destination" - William Soranno '92

  • This will display the data more accurately

    selectdf.name AS LogicalFileName

    , isnull(fg.name, 'Log') AS FilegroupName

    , physical_name AS PhysicalOSName

    , (df.size * 8 / 1024) AS SizeMBs

    , case df.max_size

    when 0 then 'No Growth'

    when -1 then 'Unlimited'

    when 268435456 then '2TB'

    else cast(df.max_size / 128 AS VARCHAR(10)) + ' MBs'

    end AS MaxFileSize

    , case df.is_percent_growth

    when 0 then cast(df.growth / 128 AS VARCHAR(10)) + ' MBs'

    else CAST(df.growth AS VARCHAR(10)) + ' %'

    end AS Growth

    from sys.master_files df left outer join sys.filegroups fg ON df.data_space_id = fg.data_space_id

    order by df.type

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Thanks William and Perry for the response.

Viewing 5 posts - 1 through 4 (of 4 total)

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