sp_droppullsubscription (języka Transact-SQL)

Krople subskrypcja w bieżącej bazie danych subskrybenta.Ta procedura składowana jest wykonywany przez subskrybenta ściągania baza danych subskrypcji.

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

Składnia

sp_droppullsubscription [ @publisher= ] 'publisher'
        , [ @publisher_db= ] 'publisher_db'
        , [ @publication= ] 'publication'
    [ , [ @reserved= ] reserved ]

Argumenty

  • [ @ publisher = 'publisher"
    Is the remote server name.publisher is sysname, with no default.Jeśli wszystkich, subskrypcja jest przenoszony na wszystkich wydawców.

  • [ @ publisher_db = 'publisher_db"
    Is the name of the Publisher database.publisher_db is sysname, with no default.all means all the Publisher databases.

  • [ @ publikacja = 'publication"
    Is the publication name.publication is sysname, with no default.Jeśli wszystkich, subskrypcja jest przenoszony na wszystkich publikacji.

  • [ @ zarezerwowane = reserved
    Określone tylko w celach informacyjnych. Nieobsługiwane. Przyszła zgodność nie jest gwarantowana.

Wartości kodów powrotnych

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

Uwagi

sp_droppullsubscription w replikacja migawka i replikacja transakcyjna.

sp_droppullsubscription usuwa odpowiedni wiersz MSreplication_subscriptions (Transact-SQL) tabela i odpowiedniego agenta dystrybutora subskrybenta.Jeśli żadne wiersze pozostają w MSreplication_subscriptions (Transact-SQL), pomija tabela.

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

-- This is the batch executed at the Subscriber to drop 
-- a pull subscription to a transactional publication.
DECLARE @publication AS sysname;
DECLARE @publisher AS sysname;
DECLARE @publicationDB     AS sysname;
SET @publication = N'AdvWorksProductTran';
SET @publisher = $(PubServer);
SET @publicationDB = N'AdventureWorks2008R2';

USE [AdventureWorks2008R2Replica]
EXEC sp_droppullsubscription 
  @publisher = @publisher, 
  @publisher_db = @publicationDB, 
  @publication = @publication;
GO

Uprawnienia

Tylko członkowie sysadmin ustalonego roli serwera lub użytkownika, który utworzył subskrypcja wciągana można wykonać sp_droppullsubscription.Db_owner ustaloną rola bazy danych jest tylko możliwe wykonywanie sp_droppullsubscription Jeśli użytkownik, który utworzył subskrypcja wciągana należy do tej roli.