Aracılığıyla paylaş


sp_dropdistributor (Transact-SQL)

Dağıtıcı kaldırır.At dağıtımcı dağıtım veritabanı dışındaki herhangi bir veritabanı üzerinde Bu saklı yordam yürütülür.

Konu bağlantısı simgesiTransact-sql sözdizimi kuralları

Sözdizimi

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

Bağımsız değişkenler

  • [ @no_checks=] no_checks
    Indicates whether to check for dependent objects before dropping the Distributor.no_checks is bit, with a default of 0.

    If 0, sp_dropdistributor checks to make sure that all publishing and distribution objects in addition to the Distributor have been dropped.

    If 1, sp_dropdistributor drops all the publishing and distribution objects prior to uninstalling the distributor.

  • [ @ignore_distributor=] ignore_distributor
    Indicates whether this stored procedure is executed without connecting to the Distributor.ignore_distributor is bit, with a default of 0.

    If 0, sp_dropdistributor connects to the Distributor and removes all replication objects.If sp_dropdistributor is unable to connect to the Distributor, the stored procedure fails.

    If 1, no connection is made to the Distributor and the replication objects are not removed.Dağıtıcı kaldırılmakta veya kalıcı olarak çevrimdışı olduğunda kullanılır.Dağıtıcı sırasında bazı gelecekte yeniden kadar bu Yayımcı tarafında dağıtımcı nesneleri kaldırılmaz saat.

Dönüş Kodu Değerleri

0 (başarılı) veya 1 (başarısız)

Açıklamalar

sp_dropdistributor çoğaltma tüm türleri kullanılır.

Diğer yayımcı veya dağıtım nesneleri sunucuda yoksa sp_dropdistributor sürece başarısız @ no_checks olan küme için 1.

Bu saklı yordam yürüterek dağıtım veritabanı silmeden sonra yürütülmelidir sp_dropdistributiondb.

Örnek

-- This script uses sqlcmd scripting variables. They are in the form
-- $(MyVariable). For information about how to use scripting variables  
-- on the command line and in SQL Server Management Studio, see the 
-- "Executing Replication Scripts" section in the topic
-- "Programming Replication Using System Stored Procedures".

-- Disable publishing and distribution.
DECLARE @distributionDB AS sysname;
DECLARE @publisher AS sysname;
DECLARE @publicationDB as sysname;
SET @distributionDB = N'distribution';
SET @publisher = $(DistPubServer);
SET @publicationDB = N'AdventureWorks2008R2';

-- Disable the publication database.
USE [AdventureWorks2008R2]
EXEC sp_removedbreplication @publicationDB;

-- Remove the registration of the local Publisher at the Distributor.
USE master
EXEC sp_dropdistpublisher @publisher;

-- Delete the distribution database.
EXEC sp_dropdistributiondb @distributionDB;

-- Remove the local server as a Distributor.
EXEC sp_dropdistributor;
GO

İzinler

Yalnızca üyeleri sysadmin sabit sunucu rolü olabilir yürütmek sp_dropdistributor.