Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Please see:</p> <ul> <li><a href="https://stackoverflow.com/questions/707625/what-is-the-difference-between-shrink-and-compact-in-sql-server-ce">What is the difference between Shrink and Compact in SQL Server CE?</a></li> </ul> <p>which quotes from the <a href="http://blogs.msdn.com/sqlservercompact/archive/2007/10/26/sqlceengine-issceengine-shrink-vs-repair.aspx" rel="nofollow noreferrer">SQL Server Compact Team Blog</a>:</p> <blockquote> <p><strong>SqlCeEngine/ISSCEEngine: Shrink Vs Compact</strong> The difference between these two is much similar to Internal and External Memory Fragmentation. </p> <p>From <a href="http://msdn2.microsoft.com/en-us/library/system.data.sqlserverce.sqlceengine.shrink.aspx" rel="nofollow noreferrer">SqlCeEngine.Shrink documentation</a>:</p> <p>Reclaims wasted space in the database by moving empty and unallocated pages to the end of the file, and then truncating the file. You can configure a database to automatically shrink by setting the autoshrink threshold option in connection string. Shrink does not create a temporary database file.</p> <p>From <a href="http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlceengine.compact.aspx" rel="nofollow noreferrer">SqlCeEngine.Compact documentation</a>:</p> <p>Reclaims wasted space in the database by creating a new database file from the existing file. By creating a new database means, it reclaims the free space between rows. </p> <p>To be more clear, Shrink claims the pages which are entirely free or unallocated; where as, Compact claims the wasted space with in the page too. Hence Compact requires creating a new database file. </p> <p>Empty space with in the page could be as result of:</p> <p>1) If there were 5 rows in a page and two of them are deleted</p> <p>2) If there was a row in the middle of the page which on update required more space, has moved out of the page (Ex: nvarchar column update)</p> <p>Empty pages and unallocated pages could remain in database as a result of:</p> <p>1) All rows in a page are deleted</p> <p>2) Whole table is dropped</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload