Partilhar via


Método AvailabilityDatabase.SuspendDataMovement

Suspends the data movement on this availability database.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (em Microsoft.SqlServer.Smo.dll)

Sintaxe

'Declaração
Public Sub SuspendDataMovement
'Uso
Dim instance As AvailabilityDatabase

instance.SuspendDataMovement()
public void SuspendDataMovement()
public:
void SuspendDataMovement()
member SuspendDataMovement : unit -> unit
public function SuspendDataMovement()

Comentários

Data movement on this availability database may not yet have been suspended after a call to SuspendDataMovement() returns control to the program. The following code snippet suggests one way to pause program execution until data movement on this availability database is suspended:

Server server = new Server("PrimaryServerName");
AvailabilityGroup ag = server.AvailabilityGroups["AgName"];
AvailabilityDatabase dbToSuspend = ag.AvailabilityDatabases["DbName"];
dbToSuspend.SuspendDataMovement();
while (!dbToSuspend.IsSuspended) {
    Thread.Sleep(10000);
    dbToSuspend.Refresh();
}

Consulte também

Referência

AvailabilityDatabase Classe

Namespace Microsoft.SqlServer.Management.Smo