Solved

filegrowth settings

Posted on 2014-11-11
2
78 Views
Last Modified: 2014-11-26
1) Can I ask if there's an easy way to query in a single SQL statement, a database size, and its file-growth configuration (i.e. size/percentage.

2) How do the filegrowth settings work - for example if you don't set a max-size for a database - how do you know when the next growth increment will occur?

3) If you have configured a maxsize - is there any way to run an SQL query to list the maxsize of the DB and how far off the current size of the DB is to that maxsize?
0
Comment
Question by:pma111
  • 2
2 Comments
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 40434642
1) sp_helpdb 'DatabaseName'
2) It only grows when it fills the file. If you have an history of the file growth then you can try to guess when the next grow will occur.
3) You need to calculate by yourself or using any 3rd-tool that will do that for you.
0
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40434646
You can also work a little bit on the next code:
SELECT d.name, f.physical_name, f.name, f.type_desc, f.size, f.max_size, f.growth, f.is_percent_growth
FROM sys.master_files f
	INNER JOIN sys.sysdatabases d 
		ON f.database_id=d.dbid

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now