Delen via


SqlSyncStoreMetadataCleanup.PerformCleanup Method

Removes change-tracking metadata 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
<SuppressMessageAttribute("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")> _
<SuppressMessageAttribute("Microsoft.MSInternal", "CA908:UseApprovedGenericsForPrecompiledAssemblies")> _
Public Function PerformCleanup As Boolean
'Usage
Dim instance As SqlSyncStoreMetadataCleanup
Dim returnValue As Boolean

returnValue = instance.PerformCleanup
[SuppressMessageAttribute("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] 
[SuppressMessageAttribute("Microsoft.MSInternal", "CA908:UseApprovedGenericsForPrecompiledAssemblies")] 
public bool PerformCleanup ()
[SuppressMessageAttribute(L"Microsoft.Maintainability", L"CA1506:AvoidExcessiveClassCoupling")] 
[SuppressMessageAttribute(L"Microsoft.MSInternal", L"CA908:UseApprovedGenericsForPrecompiledAssemblies")] 
public:
bool PerformCleanup ()
/** @attribute SuppressMessageAttribute("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling") */ 
/** @attribute SuppressMessageAttribute("Microsoft.MSInternal", "CA908:UseApprovedGenericsForPrecompiledAssemblies") */ 
public boolean PerformCleanup ()
SuppressMessageAttribute("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling") 
SuppressMessageAttribute("Microsoft.MSInternal", "CA908:UseApprovedGenericsForPrecompiledAssemblies") 
public function PerformCleanup () : boolean

Return Value

true if metadata cleanup ran successfully. Otherwise false.

Example

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

See Also

Reference

SqlSyncStoreMetadataCleanup Class
SqlSyncStoreMetadataCleanup Members
Microsoft.Synchronization.Data.SqlServer Namespace