Learn how to map a user-defined function to a different stored procedure name.
When you create a user-defined function in a database that uses the a function-string class for which default generated function strings are provided, Replication Server generates a default function string. The default generated function string executes a stored procedure with the same name and parameters as the user-defined function.
For example, if you are using a default function string, you can set up a request stored procedure to execute in the replicate database by creating a stored procedure in the primary database with the same name and parameters as the user-defined function.
If you want to map the user-defined function to a different stored procedure name, use the alter function string command to configure Replication Server to deliver the stored procedure by executing a stored procedure with a different name. You can also do so in function-string classes that allow you to customize function strings.
create proc upd_sales @stor_id varchar(10), @ord_num varchar(10), @date datetime as 64 update sales set date = @date where stor_id = @stor_id and ord_num = @ord_num
create function sales_def.upd_sales (@stor_id varchar(10), @date datetime)
create proc upd_sales @stor_id varchar(10), @ord_num varchar(10), @date datetime as print "Attempting to Update Sales Table" print "Processing Update Asynchronously"
alter function string sales_def.upd_sales for rs_sqlserver_function_class output rpc 'execute real_update @stor_id = ?stor_id!param?, @date = ?date!param?'
A stored procedure in the primary database is created with the name real_update. It accepts two parameters.