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)

public:
bool PerformCleanup()

Return Value

Type: System::Boolean
true if metadata cleanup ran successfully. Otherwise false.

ExceptionCondition
ArgumentNullException

Connection is a nullptr.

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()


Show: