SnapshotLimit Property
Collapse the table of content
Expand the table of content

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)

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.

ExceptionCondition
ArgumentOutOfRangeException

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

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.

In the following example, db is an SPDatabase object.

db.Snapshots.SnapshotLimit = 4; db.Update();
Show:
© 2016 Microsoft