Use an applied function to distribute operations first performed in a primary database to replicate databases. Applied functions allow you to realize important performance benefits. For example, if a client application must update a large number of row changes, you can create an applied function that changes many rows, rather than replicating the rows individually.
To use an applied function, you first create a stored procedure in the primary database and a corresponding stored procedure in the replicate database. At a primary Replication Server, you create a function replication definition for the stored procedure. Replicate Replication Servers can subscribe to the function replication definition. When the stored procedure in the primary database is invoked, it in turn causes the invocation of the stored procedure in the replicate database managed by the subscribing replicate Replication Server.
Because Replication Server does not know in advance what data is needed by the stored procedure at the replicate databases, you must use bulk materialization or the no-materialization method when you subscribe to a function replication definition.
Replication Server executes the stored procedure in the replicate database as the maintenance user, which is consistent with normal data replication.
See “Implementing an applied function” for step-by-step instructions.