sp_addextendedproc

Description

Creates an extended stored procedure (ESP) in the master database.

Syntax

sp_addextendedproc esp_name, dll_name

Parameters

esp_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.

dll_name

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.

Examples

Example 1

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"

Usage

Permissions

Only a system administrator can execute sp_addextendedproc.

Auditing

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

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

See also

Commands create procedure

System procedures sp_dropextendedproc, sp_helpextendedproc