Share via


Shrink & Repair

SQL Server 2005 Compact Edition (SQL Server Compact Edition) can shrink a database by removing unused pages. This operation occurs without the need for another file, temporary or otherwise, to be created.

SQL Server Compact Edition can also repair a database by examining the database file for corruption and repairing it if it is required.

Note

The Shrink & Repair dialog box is available both in SQL Server Management Studio and SQL Server Management Studio Express.

Options

None

Select None if you do not want SQL Server Compact Edition to shrink or repair the database.

Shrink database by deleting free pages

Select Shrink database by deleting free pages if you want SQL Server Compact Edition to delete free pages and shrink the database.

Perform full database compaction

Select Perform full database compaction to compact the whole database without deleting pages.

Repair physically corrupted databases

Select Repair physically corrupted databases to have SQL Server Compact Edition look for database corruption and automatically repair the database.

Recover corrupted rows

If you select Repair physically corrupted databases, the Recover corrupted rows check box becomes enabled, and you can choose to preserve any corrupted rows.

Replace existing database

If you want to replace the existing database with the new version that has been shrunk or repaired, select Replace existing database.

Create new database with this filename

To create a new database during the repair process, specify the path and a new file name for the database.

Overwrite existing database file

Select Overwrite existing database file to instruct SQL Server Compact Edition to automatically overwrite the existing database during the repair process.