DatabaseOptions.AutoShrink DatabaseOptions.AutoShrink DatabaseOptions.AutoShrink Property

Definition

Gets or sets a Boolean property value that specifies whether the AUTOSHRINK database option is active.

public:
 property bool AutoShrink { bool get(); void set(bool value); };
[Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcProperty(Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcPropertyFlags.Standalone)]
public bool AutoShrink { get; set; }
Public Property AutoShrink As Boolean
Property Value

A Boolean value that specifies whether the AUTOSHRINK database option is active.

If True, the database is automatically reduced. Otherwise, False (default).

Examples

Setting Properties

Remarks

This property specifies whether the size of the database is automatically reduced when a large amount of available space occurs.

Setting the AutoShrink property is equivalent to using the AUTO_SHRINK option in ALTER DATABASE (ALTER DATABASE SET Options (Transact-SQL)).

Applies to

See Also