SqlSyncStoreMetadataCleanup.PerformCleanup Method
Removes change-tracking metadata for all scopes from the database and updates the cleanup knowledge to reflect the point where the cleanup process stopped.
Namespace: Microsoft.Synchronization.Data.SqlServer
Assembly: Microsoft.Synchronization.Data.SqlServer (in Microsoft.Synchronization.Data.SqlServer.dll)
Syntax
'Declaration
Public Function PerformCleanup As Boolean
'Usage
Dim instance As SqlSyncStoreMetadataCleanup
Dim returnValue As Boolean
returnValue = instance.PerformCleanup()
public bool PerformCleanup()
public:
bool PerformCleanup()
member PerformCleanup : unit -> bool
public function PerformCleanup() : boolean
Return Value
Type: System.Boolean
true if metadata cleanup ran successfully. Otherwise false.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Connection is a null reference (Nothing in Visual Basic). |
Examples
The following code example calls PerformCleanup for metadata that is more than 7 days old. To view this code in the context of a complete example, see How to: Clean Up Metadata for Collaborative Synchronization (SQL Server).
SqlSyncStoreMetadataCleanup metadataCleanup = new SqlSyncStoreMetadataCleanup(serverConn);
bool cleanupSuccessful;
metadataCleanup.RetentionInDays = 7;
cleanupSuccessful = metadataCleanup.PerformCleanup();
Dim metadataCleanup As New SqlSyncStoreMetadataCleanup(serverConn)
Dim cleanupSuccessful As Boolean
metadataCleanup.RetentionInDays = 7
cleanupSuccessful = metadataCleanup.PerformCleanup()