SqlSyncStoreMetadataCleanup.PerformCleanup 方法
命名空間: Microsoft.Synchronization.Data.SqlServer
組件: Microsoft.Synchronization.Data.SqlServer (在 microsoft.synchronization.data.sqlserver.dll)
語法
'宣告
<SuppressMessageAttribute("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")> _
<SuppressMessageAttribute("Microsoft.MSInternal", "CA908:UseApprovedGenericsForPrecompiledAssemblies")> _
Public Function PerformCleanup As Boolean
'用途
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
傳回值
如果成功執行了中繼資料清除,則為 true,否則為 false。
範例
下列程式碼範例會針對超過 7 天以上的中繼資料呼叫 PerformCleanup。若要在完整範例的內容中檢視這段程式碼,請參閱 HOW TO:清除共同作業同步處理的中繼資料 (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()
請參閱
參考
SqlSyncStoreMetadataCleanup 類別
SqlSyncStoreMetadataCleanup 成員
Microsoft.Synchronization.Data.SqlServer 命名空間