sp_addextendedproc Usage

You can use sp_addextendedproc as an alternative to create procedure.

The syntax is:
sp_addextendedproc esp_name, dll_name

esp_name is the name of the ESP. It must match the name of the function that supports the ESP.

dll_name is the name of the DLL containing the ESP’s supporting function.

sp_addextendedproc must be executed in the master database by a user who has the sa_role. Therefore, sp_addextendedproc always registers the ESP in the master database, unlike create procedure, which registers the ESP in the current database. Unlike create procedure, sp_addextendedproc does not allow for parameter checking in SAP ASE or for default values for parameters.

The following statements register in the master database an ESP supported by the xp_echo routine, assuming that the function is compiled in a DLL named examples.dll:

use master
sp_addextendedproc "xp_echo", "examples.dll"

See the Reference Manual: Procedures.

Related concepts
ESP Function Example