DatabaseFile.Shrink Method (Int32, ShrinkMethod)

 

Shrinks a database file.

Namespace:   Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

public void Shrink(
	int newSizeInMB,
	ShrinkMethod shrinkType
)

Parameters

newSizeInMB
Type: System.Int32

An Int32 value that specifies the new size of the database file.

shrinkType
Type: Microsoft.SqlServer.Management.Smo.ShrinkMethod

A ShrinkMethod object value that specifies the shrink options.

Return to top
Show: