Changes an existing function replication definition created by the create function replication definition command.
alter function replication definition function_rep_def { deliver as 'proc_name' | add @param_name datatype [, @param_name datatype]... | add searchable parameters @param_name[, @param_name]... | send standby {all | replication definition} parameters }
alter function replication definition titles_frep add @notes varchar(200), @pubdate datetime, @contract bit
alter function replication definition titles_frep add searchable parameters @type, @pubdate
alter function replication definition titles_frep deliver as 'newtitles'
alter function replication definition changes a function replication definition by adding replicated parameters, adding searchable parameters, specifying whether to send all parameters to the warm standby, or specifying a different name for the stored procedure to execute in the destination database.
The name, parameters, and datatypes you specify for a function replication definition you are altering must match the stored procedure you are replicating. You can specify only those parameters you are interested in replicating.
You must execute alter function replication definition at the Replication Server that manages the primary database (where you created the function replication definition).
A parameter name must not appear more than once in any clause.
If you are adding parameters, coordinate alter function replication definition with distributions for the function replication definition. Follow the steps described in "Altering a Function Replication Definition" to avoid errors.
You can use the optional deliver as clause to specify the name of the stored procedure to execute at the destination database where you are delivering the replicated function. Typically, you use this option in request function delivery. For more information, see create connection.
See the Replication Server Administration Guide Volume 1 for more information on alter function replication definition.
Ideally, you should first quiesce primary updates and ensure that all primary updates have been processed by the replication system. If you are unable to do that, then old updates in the primary log will not have values for new parameters, and the replication system will use nulls instead. You may need to take this into account when altering function strings in step 4 below.
Alter the function replication definition. Wait for the modified function replication definition to arrive at the replicate sites.
If necessary, alter any function strings pertaining to the function replication definition. Wait for the modified function strings to arrive at the replicate sites.
Altering a replication definition does not affect current subscriptions. If new parameters are added to the function replication definition, they are replicated with any new updates for all existing subscriptions.