There are several restrictions when you use replicated stored procedures.
The names of all replication definitions, including function replication definitions, must be unique in the replication system.
Otherwise, the existing request function replication will be disabled. See Replication Server 15.6 Administration Guide Volume 2 > Pre-15.1 Request Function Replication.
Replication Server does not support nested transactions—those containing begin or commit statements—within replicated stored procedures.
When the maint_user or the replicate database replicates a stored procedure, using sp_setrepproc or sp_setreplicate, Adaptive Server always executes the stored procedure within a transaction. Even if you have not explicitly executed the replicated stored procedure within a transaction at the primary database, Adaptive Server places an implicit begin transaction at the start of the procedure when it is applied by the maint_user in the replicate database.
For more information, see dsi_max_xacts_in_group in Replication Server Administration Guide Volume 2 > Performance Tuning > Configuration Parameters that Affect Performance > Connection Parameters that Affect Performance . If the replicated stored procedure contains such commands as begin transaction, commit transaction, or rollback transaction, errors may result when you execute the procedure. For example, a rollback transaction command might roll back to the start of the transaction group, rather than to the nested begin transaction command that was the intended rollback point.
Replicated functions, like Adaptive Server stored procedures, cannot contain parameters with text and image datatypes. Refer to the Adaptive Server Enterprise Reference Manual.
If the user does not begin a transaction explicitly, Adaptive Server begins one in the user’s current database before the stored procedure is invoked.
If the user begins the transaction in one database and then executes a replicated stored procedure in another database, the execution is still logged in the database where the transaction began.
If a single transaction invokes one or more request functions and executes applied functions or contains data modification language, or a mixed-mode transaction, Replication Server processes the request functions after all the other operations have completed, together in a separate transaction.
You cannot alter the datatype of a parameter value using create applied/request function replication definition or alter applied/request function replication definition. However, you can use datatype definitions to declare parameters for applied function replication definitions, which are then subject to class-level translations.
Replication Server does not perform translations on parameter values for request functions. However, during function-string mapping, the delimiters defined for the parameter values of their declared datatype are used to generate the SQL.