ReplicationServer.UninstallDistributor-Methode
Uninstalls replication publishing and distribution on the currently connected instance of SQL Server.
Namespace: Microsoft.SqlServer.Replication
Assembly: Microsoft.SqlServer.Rmo (in Microsoft.SqlServer.Rmo.dll)
Syntax
'Declaration
Public Sub UninstallDistributor ( _
force As Boolean _
)
'Usage
Dim instance As ReplicationServer
Dim force As Boolean
instance.UninstallDistributor(force)
public void UninstallDistributor(
bool force
)
public:
void UninstallDistributor(
bool force
)
member UninstallDistributor :
force:bool -> unit
public function UninstallDistributor(
force : boolean
)
Parameter
- force
Typ: System.Boolean
A Boolean value that specifies whether or not replication objects are removed from the server, even if a remote Distributor cannot be reached. If true, the publishing and Distributor configuration at the current server is uninstalled regardless of whether or not dependent publishing and distribution objects are uninstalled. If false, all dependent publishing and distribution objects are dropped before the Distributor is uninstalled.
Hinweise
Before calling UninstallDistributor, you must first perform the following tasks:
Delete all subscriptions. For more information, see Vorgehensweise: Löschen eines Pushabonnements (RMO-Programmierung) and Vorgehensweise: Löschen eines Pullabonnements (RMO-Programmierung).
Delete all publications. For more information, see Vorgehensweise: Löschen einer Veröffentlichung (RMO-Programmierung).
Drop any distribution databases. For more information, see Vorgehensweise: Deaktivieren von Veröffentlichung und Verteilung (RMO-Programmierung).
The UninstallDistributor method can only be called by members of the sysadmin fixed server role.
The UninstallDistributor method is equivalent to executing the sp_dropdistributor (Transact-SQL) stored procedure.
Beispiele
myDist.UninstallDistributor(false);