Transact-SQL Reference

sp_addextendedproc

Registers the name of a new extended stored procedure to Microsoft® SQL Server™.

Syntax

sp_addextendedproc [ @functname = ] 'procedure' ,
    [ @dllname = ] 'dll'

Arguments

[ @functname = ] 'procedure'

Is the name of the function to call within the dynamic-link library (DLL). procedure is nvarchar(517), with no default. procedure optionally can include the owner name in the form owner.function.

[ @dllname = ] 'dll'

Is the name of the DLL containing the function. dll is varchar(255), with no default.

Return Code Values

0 (success) or 1 (failure)

Result Sets

None

Remarks

Programmers using Microsoft Open Data Services can create extended stored procedures. After an extended stored procedure is created, it must be added to SQL Server using sp_addextendedproc. For more information, see Creating Extended Stored Procedures.

Only add an extended stored procedure to the master database. To execute an extended stored procedure from a database other than master, qualify the name of the extended stored procedure with master.

sp_addextendedproc adds entries to the sysobjects table, registering the name of the new extended stored procedure with SQL Server. It also adds an entry in the syscomments table.

Permissions

Only members of the sysadmin fixed server role can execute sp_addextendedproc.

Examples

This example adds the xp_hello extended stored procedure.

USE master
EXEC sp_addextendedproc xp_hello, 'xp_hello.dll'

See Also

EXECUTE

GRANT

REVOKE

sp_dropextendedproc

sp_helpextendedproc

System Stored Procedures