Creates an extended stored procedure (ESP) in the master database.
sp_addextendedproc esp_name, dll_name
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 – $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 and $SYBASE/lib on other platforms.
(On Windows) 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.
See also create procedure in Reference Manual: Commands.
The permission checks for sp_addextendedproc differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be a user with manage any ESP privilege. |
Disabled | With granular permissions disabled, you must be a user with sa_role. |
Values in event and extrainfo columns from the sysaudits table are:
Information | Values |
---|---|
Event | 38 |
Audit option | exec_procedure |
Command or access audited | Execution of a procedure |
Information in extrainfo |
|