Shrink File (General Page)

Use this dialog box to shrink the size of a file.

Database

Displays the name of the selected database.

File type

Select the file type for the file. The available choices are Data and Log files. The default selection is Data. Selecting a different filegroup type changes the selections in the other fields accordingly. This option is only available if connected to an instance of Microsoft SQL Server 2000 or SQL Server 7.0.

Filegroup

Select a filegroup from the list of Filegroups associated with the selected File type above. Selecting a different filegroup changes the selections in the other fields accordingly.

File name

Select a file from the list of available files of the selected filegroup and file type.

Location

Displays the full path to the currently selected file. The path is not editable, but it can be copied to the clipboard.

Currently allocated space

For data files, displays the current allocated space. For log files, displays the current allocated space computed from the output of DBCC SQLPERF(LOGSPACE).

Available free space

For data files, displays the current available free space computed from the output of DBCC SHOWFILESTATS(fileid). For log files, displays the current available free space computed from the output of DBCC SQLPERF(LOGSPACE).

Release unused space

Cause any unused space in the files to be released to the operating system and shrink the file to the last allocated extent, reducing the file size without moving any data. No attempt is made to relocate rows to unallocated pages.

Reorganize pages before releasing unused space

Equivalent to executing DBCC SHRINKFILE specifying the target file size. When this option is selected, the user must specify a target file size in the Shrink file to box.

Shrink file to

Specifies the target file size for the shrink operation. The size cannot be less than the current allocated space or more than the total extents allocated to the file. Entering a value beyond the minimum or the maximum will revert to the min or the max once the focus is changed or when any of the buttons on the toolbar are clicked.

Empty file by migrating the data to other files in the same filegroup

Migrate all data from the specified file. This option allows the file to be dropped using the ALTER DATABASE statement. This option is equivalent to executing DBCC SHRINKFILE with the EMPTYFILE option.

Community Additions

ADD
Show: