Creates an extended stored procedure (ESP) in the master database.
sp_addextendedproc esp_name, dll_name
is the name of the extended stored procedure. This name must be identical to the name of the procedural language function that implements the ESP. esp_name must be a valid Adaptive Server identifier.
is the name of the dynamic link library (DLL) file containing the function specified by esp_name. The dll_name can be specified with no extension or with its platform-specific extension, such as .dll on Windows NT or .so on Sun Solaris. If an extension is specified, the dll_name must be enclosed in quotation marks.
Registers an ESP for the function named my_esp, which is in the sqlsrvdll.dll file. The name of the resulting ESP database object is also my_esp:
sp_addextendedproc my_esp, "sqlsrvdll.dll"
Execute sp_addextendedproc from the master database.
You can only use sp_addextendedproc to add extended stored procedures that take no parameters. If your extended stored procedure requires a formal parameter list, you must use the create procedure command with the as external name option, together with the complete parameter list.
The esp_name is case sensitive. It must match the name of the function in the DLL.
The DLL represented by dll_name must reside on the server machine on which the ESP is being created and the DLL directory must be in:
Windows NT – $PATH
Compaq Tru64 – $LD_LIBRARY_PATH
HP – $SH_LIBRARY_PATH
If the file is not found, the search mechanism also searches $SYBASE/dll on Windows NT and $SYBASE/lib on other platforms.
On Windows NT – an ESP function should not call a C run-time signal routine. This can cause XP Server to fail, because Open Server™ does not support signal handling on Windows NT.
Only a System Administrator can execute sp_addextendedproc.
Values in event and extrainfo columns from the sysaudits table are:
Event |
Audit option |
Command or access audited |
Information in extrainfo |
---|---|---|---|
38 |
exec_procedure |
Execution of a procedure |
|
Commands create procedure
System procedures sp_dropextendedproc, sp_helpextendedproc