Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Probably a very dumb file size question... Expand / Collapse
Author
Message
Posted Tuesday, July 2, 2013 11:08 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, May 27, 2016 2:48 PM
Points: 1,424, Visits: 9,259
So I was adjusting the size of a DB for a customer (increasing the size of his QA DB) and noticed something. SQL will let you set an initial size that is larger than the maximum size in Autogrowth.

So, my question, what happens if you do this? If you create a DB (or increase the initial size of a DB) so that, for example, the initial size is 10MB while the maximum size in Autogrowth is 5MB. What would SQL do? Still tell you that there's no space in the DB, or would it let you go up to the new initial size but not beyond?

Just curious, and don't have a system handy to try this out on...
Jason
Post #1469675
Posted Wednesday, July 3, 2013 3:49 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, May 16, 2016 6:42 AM
Points: 51, Visits: 422
well, as long as you have disk, you can pre-grow you file to any desired size. Think of it as a book. You can allocate unused pages, but data will be only filled once you write to those pages. It will remain at the pre grown size but if you use the shrink option, you will be able to see the amount of data vs the amount of space available.
Hope this helps :)
Post #1469959
Posted Wednesday, July 3, 2013 5:39 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 10:21 AM
Points: 40,541, Visits: 37,779
jasona.work (7/2/2013)
So I was adjusting the size of a DB for a customer (increasing the size of his QA DB) and noticed something. SQL will let you set an initial size that is larger than the maximum size in Autogrowth.

So, my question, what happens if you do this? If you create a DB (or increase the initial size of a DB) so that, for example, the initial size is 10MB while the maximum size in Autogrowth is 5MB. What would SQL do? Still tell you that there's no space in the DB, or would it let you go up to the new initial size but not beyond?

Just curious, and don't have a system handy to try this out on...
Jason


You will get an error, as you expected, saying that the "MAX size cannot be less than SIZE".


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

Helpful Links:
How to post code problems
How to post performance problems
Post #1470268
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse