UninstallDistributor 方法

Uninstalls replication publishing and distribution on the currently connected instance of SQL Server. 

命名空间:  Microsoft.SqlServer.Replication
程序集:  Microsoft.SqlServer.Rmo(在 Microsoft.SqlServer.Rmo.dll 中)

语法

声明
Public Sub UninstallDistributor ( _
    force As Boolean _
)
用法
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
)

参数

  • force
    类型: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.

注释

Before calling UninstallDistributor, you must first perform the following tasks:

  1. Delete all subscriptions. For more information, see 如何删除推送订阅(RMO 编程) and 如何删除请求订阅(RMO 编程).

  2. Delete all publications. For more information, see 如何删除发布(RMO 编程).

  3. Drop any distribution databases. For more information, see 如何禁用发布和分发(RMO 编程).

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.

This namespace, class, or member is supported only in version 2.0 of the .NET Framework.

示例

myDist.UninstallDistributor(false);