Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
sp_dropmergepullsubscription (Transact-SQL)
Collapse the table of content
Expand the table of content

sp_dropmergepullsubscription (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Drops a merge pull subscription. This stored procedure is executed at the Subscriber on the subscription database.

Topic link icon Transact-SQL Syntax Conventions

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

[ @publication=] 'publication'

Is the name of the publication. publication is sysname, with a default of NULL. This parameter is required. Specify a value of all to remove subscriptions to all publications

[ @publisher=] 'publisher'

Is the name of the Publisher. publisheris sysname, with a default of NULL. This parameter is required.

[ @publisher_db=] 'publisher_db'

Is the name of the Publisher database. publisher_dbis sysname, with a default of NULL. This parameter is required.

[ @reserved=] 'reserved'

Is reserved for future use. reserved is bit, with a default of 0.

0 (success) or 1 (failure)

sp_dropmergepullsubscription is used in merge replication.

sp_dropmergepullsubscription drops the Merge Agent for this merge pull subscription, although the Merge Agent is not created in sp_addmergepullsubscription.

-- 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 batch is executed at the Subscriber to remove 
-- a merge pull subscription.
DECLARE @publication AS sysname;
DECLARE @publisher AS sysname;
DECLARE @publication_db AS sysname;
SET @publication = N'AdvWorksSalesOrdersMerge';
SET @publisher = $(PubServer);
SET @publication_db = N'AdventureWorks2012';

USE [AdventureWorks2012Replica]
EXEC sp_dropmergepullsubscription 
  @publisher = @publisher, 
  @publisher_db = @publication_db, 
  @publication = @publication;
GO

Only members of the sysadmin fixed server role or the user that created the merge pull subscription can execute sp_dropmergepullsubscription. The db_owner fixed database role is only able to execute sp_dropmergepullsubscription if the user that created the merge pull subscription belongs to this role.

Community Additions

ADD
Show:
© 2015 Microsoft