sp_dropmergepullsubscription (Transact-SQL)

適用於:SQL Server

卸除合併提取訂閱。 這個預存程式會在訂閱資料庫的訂閱者端執行。

Transact-SQL 語法慣例

語法

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

引數

[ @publication = ] N'publication'

發行集的名稱。 @publication為 sysname,預設值為 NULL。 此為必要參數。 指定要移除所有發行集訂閱的 值 all

[ @publisher = ] N'publisher'

發行者的名稱。 @publisher為 sysname,預設值為 NULL。 此為必要參數。

[ @publisher_db = ] N'publisher_db'

發行者資料庫的名稱。 @publisher_db為 sysname,預設值為 NULL。 此為必要參數。

[ @reserved = ] 保留

保留供未來使用。 @reserved為 bit,預設值為 0

傳回碼值

0 (成功)或 1 (失敗)。

備註

sp_dropmergepullsubscription 用於合併式複寫。

sp_dropmergepullsubscription會卸除此合併提取訂閱的 合併代理程式,但不會在 中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'AdventureWorks2022';

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

權限

只有系統管理員固定伺服器角色的成員或建立合併提取訂閱的使用者才能執行 sp_dropmergepullsubscriptiondb_owner固定資料庫角色只有在建立合併提取訂閱的用戶屬於此角色時,才能執行sp_dropmergepullsubscription