Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SPDatabase.Snapshots Property

Gets the snapshots of the database.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

public SPDatabaseSnapshotCollection Snapshots { get; }

Property Value

Type: Microsoft.SharePoint.Administration.Backup.SPDatabaseSnapshotCollection
All of the currently existing snapshots of the database.

Typically, administrators set snapshots to be taken on a regularly scheduled basis. In addition, snapshots have a fixed lifespan, usually measured in hours, after which they go out of existence. Hence, the membership of this property is highly dynamic.

The collection may be empty, but the property never returns a a null reference (Nothing in Visual Basic) reference.

NoteNote

Only the Enterprise and Developer editions of Microsoft SQL Server support database snapshots.

Caution noteCaution

Snapshots are typically created and deleted automatically by timer jobs in the background. To help ensure that the SPDatabaseSnapshotCollection object represents the current set of snapshots, always call the RefreshSnapshots() method before you access or process any members of the collection. This point applies also when you access a snapshot through an indexer. For example, if spd is an SPDatabase object, the line spd.Snapshots[0] should be preceded by a call of the RefreshSnapshots() method.

Show:
© 2015 Microsoft