How to find Autogrowth OFF in DMVs

  • So I need to write a script to look for available free space percentage in my databases, but I only want it to look at capped files. We consider a file with autogrowth off as capped for our purposes. This is my problem: in sys.database_files and sys.master_files, if I have autogrowth off then max_size is -1, which is the same value as unlimited growth. I cannot find another setting anywhere to determine how SQL Server recognizes that a particular file is set to not allow autogrowth. Can anyone point me to a setting in a DMV anywhere where I can see whether autogrowth is disabled or not?

  • Figured out the answer -- you have to look at both the Max_size which will be -1 and the Growth which will be 0.

  • Thanks for posting the answer to your question. That'll be helpful when someone else with the same one finds this using a search.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

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

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