SPDatabaseSnapshotCollection.SnapshotLimit Property

Gets or sets the maximum number of database snapshots that can be saved.

Namespace:  Microsoft.SharePoint.Administration.Backup
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Property SnapshotLimit As Short
    Get
    Set
'Usage
Dim instance As SPDatabaseSnapshotCollection
Dim value As Short

value = instance.SnapshotLimit

instance.SnapshotLimit = value
public short SnapshotLimit { get; set; }

Property Value

Type: System.Int16
The maximum number of database snapshots of the database that can exist at any one time.

Exceptions

Exception Condition
ArgumentOutOfRangeException

An attempt is made to set the property to a value greater than 100 or a negative number.

Remarks

The SnapshotLimit property cannot be set to more than 100.

Each time the value of a field on a list item is changed, the old value must be written to every existing database snapshot. Performance of the database can deteriorate significantly if the SnapshotLimit property is greater than 3.

The SnapshotLimit property is ignored by the built-in database snapshot management system of SharePoint Foundation if EnabledManagement is false.

You must call Update() to save changes to this property.

Examples

In the following example, db is an SPDatabase object.

db.Snapshots.SnapshotLimit = 4; db.Update();

See Also

Reference

SPDatabaseSnapshotCollection Class

SPDatabaseSnapshotCollection Members

Microsoft.SharePoint.Administration.Backup Namespace