Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 2.91 KB

File metadata and controls

61 lines (46 loc) · 2.91 KB
title sp_addmergepartition (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/06/2017
ms.prod sql
ms.prod_service database-engine
ms.reviewer
ms.technology replication
ms.topic language-reference
f1_keywords
sp_addmergepartition
sp_addmergepartition_TSQL
helpviewer_keywords
sp_addmergepartition
ms.assetid 02a5f46b-e5ff-4932-a3ff-7f0fd82d0981
author stevestein
ms.author sstein

sp_addmergepartition (Transact-SQL)

[!INCLUDEappliesto-ss-asdbmi-xxxx-xxx-md]

Creates a dynamically filtered partition for a subscription that is filtered by the values of HOST_NAME or SUSER_SNAME at the Subscriber. This stored procedure is executed at the Publisher on the database that is being published, and is used to manually generate partitions.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sp_addmergepartition [ @publication = ] 'publication'  
        , [ @suser_sname = ] 'suser_sname'  
        , [ @host_name = ] 'host_name'  

Arguments

[ @publication = ] 'publication' Is the merge publication on which the partition is being created. publication is sysname, with no default. If suser_sname is specified, the value of hostname must be NULL.

[ @suser_sname = ] 'suser_sname' Is the value used when creating the partition for a subscription that is filtered by the value of the SUSER_SNAME function at the Subscriber. suser_sname is sysname, with no default.

[ @host_name = ] 'host_name' Is the value used when creating the partition for a subscription that is filtered by the value of the HOST_NAME function at the Subscriber. host_name is sysname, with no default.

Return Code Values

0 (success) or 1 (failure)

Remarks

sp_addmergepartition is used in merge replication.

Example

[!code-sqlHowTo#sp_MergeDynamicPubPlusPartition]

Permissions

Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_addmergepartition.

See Also

Create a Snapshot for a Merge Publication with Parameterized Filters
Parameterized Row Filters