Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Script to change auto growth settings for all databases in SQL Server

By Shashank Srivastava,

This script is going to change the auto growth setting of database files of all databases except Master & Msdb by 100 MB. This script is very useful while performing the SQL RAP exercise.  

If you want to change the auto growth size from 100 to some other value then just modify the filegrowth value in script at below location.

BEGIN 

    PRINT 'Changing AutoGrowth option for database:- '+ UPPER(@name) 

    SET @Query  = 'ALTER DATABASE '+ @name +' MODIFY FILE (NAME = '+@vFileName+',FILEGROWTH = 100MB)' 

    EXECUTE(@Query) BEGIN 

    PRINT 'Changing AutoGrowth option for database:- '+ UPPER(@name) 

    SET @Query  = 'ALTER DATABASE '+ @name +' MODIFY FILE (NAME = '+@vFileName+',FILEGROWTH = 100MB)' 

    EXECUTE(@Query)   

I am hopeful that this script is going to be very helpful to each one of you.

Total article views: 1776 | Views in the last 30 days: 56
 
Related Articles
FORUM

Determining Filegrowth for a completely new database

How can i determine (by calculations or other means ) the percentage of filegrowth for a newly creat...

FORUM

Changing MDF and LDF FILEGROWTH

Hi all! I am interested in changing the filegrowth property of both my mdf and ldf on several hundr...

FORUM

Determining Filegrowth for a completely new database

How can i determine (by calculations or other means ) the percentage of filegrowth for a newly creat...

FORUM

Working with multiple Database change Release.

Latest database change script release should check for previous database change too

FORUM

Changing db owner script

need to change multiple databases on many servers

Tags
administration    
autogrowth    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones