Replication of UDAs and UDFs

All UDAs and UDFs (user-supplied code that implements the various phases of aggregate and function evaluation) or transactions that call a UDA or UDF and update non-temporary tables in a replicated database trigger by-value replication.

A CREATE / ALTER FUNCTION / AGGREGATE has two clauses, EXTERNAL HOST OBJECT and EXTERNAL SPU OBJECT, that are compiled objects on the file system and are used for executing the UDF or UDA code on the host and the SPU. Calls and dependencies of a UDA or UDF must be to a replicated database. For example, there is an optional DEPENDENCIES clause that lists the dependent libraries. You must define each listed library in a replicated database, or the command fails. A UDA or UDF can be referenced in a cross-database query; normal cross-database rules apply.

For non-replication-specific information about UDAs and UDFs, see User-defined functions .