共用方式為


SqlSyncStoreRestore.PerformPostRestoreFixup 方法

命名空間: Microsoft.Synchronization.Data.SqlServer
組件: Microsoft.Synchronization.Data.SqlServer (在 microsoft.synchronization.data.sqlserver.dll)

語法

'宣告
Public Sub PerformPostRestoreFixup
'用途
Dim instance As SqlSyncStoreRestore

instance.PerformPostRestoreFixup
public void PerformPostRestoreFixup ()
public:
void PerformPostRestoreFixup ()
public void PerformPostRestoreFixup ()
public function PerformPostRestoreFixup ()

備註

在您已經從備份還原 SQL Server 資料庫之後,請使用這個方法。Sync Framework 會針對資料庫中已設定的所有範圍更新同步處理中繼資料。如需詳細資訊,請參閱 HOW TO:備份和還原資料庫 (SQL Server)

範例

下列程式碼範例會還原伺服器資料庫,方法是呼叫其中一個範例 Utility 方法,然後呼叫 PerformPostRestoreFixup 來更新中繼資料。若要在完整應用程式的內容中檢視這段程式碼,請參閱 HOW TO:備份和還原資料庫 (SQL Server)

Utility.RestoreDatabaseFromBackup();


// Call the API to update synchronization metadata to reflect that the database was
// just restored. The restore stored procedure kills the connection to the
// server, so we must re-establish it.
SqlConnection.ClearPool(serverConn);
serverConn = new SqlConnection(Utility.ConnStr_SqlSync_Server);
SqlSyncStoreRestore databaseRestore = new SqlSyncStoreRestore(serverConn);
databaseRestore.PerformPostRestoreFixup();
Utility.RestoreDatabaseFromBackup()


' Call the API to update synchronization metadata to reflect that the database was 
' just restored. The restore stored procedure kills the connection to the 
' server, so we must re-establish it. 
SqlConnection.ClearPool(serverConn)
serverConn = New SqlConnection(Utility.ConnStr_SqlSync_Server)
Dim databaseRestore As New SqlSyncStoreRestore(serverConn)
databaseRestore.PerformPostRestoreFixup()

請參閱

參考

SqlSyncStoreRestore 類別
SqlSyncStoreRestore 成員
Microsoft.Synchronization.Data.SqlServer 命名空間