Probably a very dumb file size question...

  • 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

  • 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 🙂

  • 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.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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