| 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 |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | 02a5f46b-e5ff-4932-a3ff-7f0fd82d0981 | ||
| author | stevestein | ||
| ms.author | sstein |
[!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.
Transact-SQL Syntax Conventions
sp_addmergepartition [ @publication = ] 'publication'
, [ @suser_sname = ] 'suser_sname'
, [ @host_name = ] 'host_name'
[ @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.
0 (success) or 1 (failure)
sp_addmergepartition is used in merge replication.
[!code-sqlHowTo#sp_MergeDynamicPubPlusPartition]
Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_addmergepartition.
Create a Snapshot for a Merge Publication with Parameterized Filters
Parameterized Row Filters