Transact-SQL 参考

sp_dropdistributor

卸载分发服务器。该存储过程在分发服务器的任何数据库上执行。

语法

sp_dropdistributor [ [ @no_checks = ] no_checks ]
    [ , [ @ignore_distributor = ] ignore_distributor ]

参数

[@no_checks =] no_checks

表示在除去分发服务器前是否检查相关对象。no_checks 的数据类型为 bit,默认设置为 0。如果是 0,则表示 sp_dropdistributor 将进行检查以确保不仅除去分发服务器,还除去所有发布对象和分发对象。如果是 1,则表示 sp_dropdistributor 不进行检查即除去所有发布对象和分发对象。

[@ignore_distributor =] ignore_distributor

表示是否在不连接到分发服务器的情况下执行该存储过程。ignore_distributor 的数据类型为 bit,默认设置为 0。如果是 0,则表示 sp_dropdistributor 连接到分发服务器并删除所有复制对象。如果 sp_dropdistributor 不能连接到分发服务器,则该存储过程失败。如果是 1,则表示不与分发服务器建立连接,也不删除复制对象。如果分发服务器正卸载或永久脱机,则使用该设置。不会删除分发服务器上的发布服务器对象,直到在将来的某个时间重新安装分发服务器。

返回代码值

0(成功)或 1(失败)

注释

sp_dropdistributor 用于所有类型的复制。

如果在服务器上有其它的发布服务器或分发对象,则 sp_dropdistributor 将失败,除非 @no_checks 设置为 1

必须先执行 sp_dropdistributiondb 除去分发数据库后再执行该存储过程。

权限

只有 sysadmin 固定服务器角色成员才能执行 sp_dropdistributor

请参见

sp_adddistributor

sp_changedistributor_property

sp_helpdistributor

系统存储过程