An extended stored procedure (ESP) uses the same interface as a stored procedure, but instead of containing SQL statements and control-of-flow statements, it executes procedural language code that has been compiled into a dynamic link library (DLL).
The procedural language in which an ESP function is written can be any language capable of calling C language functions and manipulating C datatypes.
ESPs allow SAP ASE to perform a task outside the relational database management system (RDBMS), in response to an event occurring within the database. For example, you could use an ESP to send an e-mail notification or network-wide broadcast in response to an event occurring within the RDBMS.
There are some SAP ASE-supplied ESPs, called system extended stored procedures. One of these, xp_cmdshell, allows you to execute an operating system command from within SAP ASE.
ESPs are implemented by an Open Serverâ„¢ application called XP Serverâ„¢, which runs on the same machine as your SAP ASE server. Remote execution of a stored procedure is called a remote procedure call (RPC). Your SAP ASE server and XP Server communicate through RPCs. XP Server is automatically installed with SAP ASE.
See, System Extended Stored Procedures, in the Reference Manual: Procedures.