Using applied functions

You can also use applied functions to replicate stored procedure invocations to remote sites with replicate data. If you use applied functions to replicate primary data, you can:

In the following example, a client application at the primary (Tokyo) site executes a user stored procedure, upd_publishers_pubs2, which makes changes to the publishers table in the primary database. Execution of upd_publishers_pubs2 invokes function replication, which causes the corresponding stored procedure, also named upd_publishers_pubs2, to execute on the replicate data server.

To create an applied function for an application that implements the basic primary copy model, you need to:

At the primary site:

At the replicate site:

Figure 3-2: Basic primary copy model using applied functions

Figure 3-2 shows an example of the basic primary model using applied functions. A client application at the primary site executes a stored procedure which makes changes to the publishers table in the primary database. Execution of the stored procedure causes the corresponding stored procedure at the replicate site to execute on the replicate data server and change the replicate data.