sp_dropdistpublisher (języka Transact-SQL)

Krople dystrybucji Wydawca.Ta procedura składowana jest wykonywany na dystrybutora na dowolnej bazy danych.

Ikona łącza do tematuKonwencje składni Transact-SQL

Składnia

sp_dropdistpublisher [ @publisher = ] 'publisher'
    [ , [ @no_checks = ] no_checks ]
    [ , [ @ignore_distributor = ] ignore_distributor ]

Argumenty

  • [ @publisher= ] 'publisher'
    Is the Publisher to drop.publisher is sysname, with no default.

  • [ @no_checks= ] no_checks
    Specifies whether sp_dropdistpublisher checks that the Publisher has uninstalled the server as the Distributor.no_checks is bit, with a default of 0.

    Jeśli 0, replikacja weryfikuje, że zdalny Wydawca został odinstalowany lokalny serwer jako dystrybutor.Wydawca jest lokalna, replikacja weryfikuje, że nie ma obiektów publikacja lub dystrybucji na serwerze lokalnym.

    Jeśli 1, obiekty replikacja skojarzone z rozkładem Wydawca są opuszczane, nawet jeśli zdalny Wydawca nie może być osiągnięty.Po wykonaniu tego zdalnego Wydawca należy odinstalować, przy użyciu replikacja sp_dropdistributor z @ ignore_distributor = 1.

  • [ @ignore_distributor= ] ignore_distributor
    Specifies whether distribution objects are left at the Distributor when the Publisher is removed.ignore_distributor is bit and can be one of these values:

    1 = dystrybucji obiektów należących do wydawcy pozostają u dystrybutora.

    0 = obiektów dystrybucji dla wydawcy są oczyszczony u dystrybutora.

Wartości kodów powrotnych

0 (sukces) lub 1 (błąd)

Uwagi

sp_dropdistpublisher jest używana we wszystkich typach replikacja.

Gdy upuszczanie Wydawca Oracle, jeśli nie można upuścić wydawcy sp_dropdistpublisher zwraca błąd i obiekty dystrybutora wydawcy są usuwane.

Przykład

-- 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

Uprawnienia

Tylko członkowie sysadmin stała rola serwera można wykonać sp_dropdistpublisher.