• Lowell (12/5/2012)


    http://sqlserverpedia.com/wiki/Heaps#Deletes_and_Heaps

    Deletes and Heaps

    When data is deleted from a heap using a DELETE statement, SQL Server will not release the space; it remains allocated to the heap. This leads to space bloat that wastes valuable resources. To address this problem, you can do any of the following:

    That's not entirely true. Mostly true, just not completely true.

    When data is deleted from a heap using a DELETE statement, SQL Server will not release the space, unless the delete has taken a table lock.

    The cited page has a lot of 'mostly true' statements, so be a little careful with it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass