1

When you drop tables, does the empty space get automatically reused, or do you need to do some sort of maintenance to allow that space to get reused?

Consider a situation where you drop and recreate a large lookup table routinely. For instance, every day. Is this going to use more and more space until you perform some maintenance like shrinking the data file, or something like that? Or will the old space get overwritten with new data as if it were a hard drive?

SQL 2014 if it makes a difference.

1 Answer 1

3

When in doubt, read the documentation first:

TRUNCATE TABLE removes the data by deallocating the data pages used to store the table data and records only the page deallocations in the transaction log.

So it deallocates the pages and make them available for reuse.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.