A function replication definition specifies information about a stored procedure that is to be replicated. The replication source and destination databases can be primary or replicate databases.
Create a function replication definition in the Replication Server that manages the primary database.
The function replication definition includes:
A name for the function replication definition. This name is usually the same as that of the stored procedure to be executed in the source database. The only exception is @rs_repdef.
The location of the primary data.
The names and datatypes of the stored procedure parameters to be replicated.
The function replication definition can optionally include:
The name of the stored procedure to be executed in the destination database, if it is different from the name of the function replication definition.
The names of parameters that can be referenced in where clauses for subscriptions.
Whether the function replication definition and its parameters will be used in replicating to a standby database.
Use these commands to work with function replication definitions:
create function replication definition – creates a replication definition for a stored procedure.
alter function replication definition – changes a function replication definition.
drop function replication definition – removes a function replication definition.
No data is distributed when you create a function replication definition. You must create stored procedures in both the source and destination databases.
If a stored procedure is to be replicated from a primary to a replicate database, you must create a subscription at the replicate Replication Server. You don’t need a subscription for a stored procedure that is to be replicated from a replicate to a primary database.
See “Subscription commands” for commands that you use in subscribing to replication definitions.