Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 12:16 PM
Points: 961, Visits: 4,973
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: Friday, December 6, 2013 12:45 AM
Points: 51, Visits: 321
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-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 11:31 AM
Points: 36,714, Visits: 31,164
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

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

Add to briefcase

Permissions Expand / Collapse